String sdkPath = defaultHomePath + File.separatorChar + SDKSUFFIX;
boolean status = true;
if (HostUtil.exists(sdkPath)) {
- String[] fileContent = HostUtil.getContents(sdkPath).split("=");
- if (HostUtil.exists(fileContent[1])) {
- sdkInstallPath = fileContent[1];
- }
- else {
+ String contents = HostUtil.getContents(sdkPath);
+ if (StringUtil.isEmpty(contents)) {
status = false;
+ } else {
+ String[] fileContent = contents.split("=");
+ if (HostUtil.exists(fileContent[1])) {
+ sdkInstallPath = fileContent[1];
+ } else {
+ status = false;
+ }
}
} else {
status = false;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.jface.dialogs.ControlEnableState;
import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.preference.PreferenceDialog;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.jface.window.Window;
import org.eclipse.swt.SWT;
protected final void openWorkspacePreferences(Object data) {
String id= getPreferencePageID();
- PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, data).open();
+ PreferenceDialog dialog= PreferencesUtil.createPreferenceDialogOn(getShell(), id, new String[] { id }, data);
+ if (dialog != null) {
+ dialog.open();
+ }
}
protected final void openProjectProperties(IProject project, Object data) {
String id= getPropertyPageID();
if (id != null) {
- PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, data).open();
+ PreferenceDialog dialog= PreferencesUtil.createPropertyDialogOn(getShell(), project, id, new String[] { id }, data);
+ if (dialog != null) {
+ dialog.open();
+ }
}
}
import static org.tizen.common.util.StringUtil.trim;
import java.io.BufferedReader;
-import java.io.BufferedWriter;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.FileReader;
-import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStreamReader;
-import java.nio.channels.FileChannel;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;