use of org.eclipse.jface.dialogs.IDialogSettings in project cubrid-manager by CUBRID.
the class LoadDatabaseDialog method initial.
/**
*
* Initial data
*
*/
private void initial() {
IDialogSettings dialogSettings = CubridManagerUIPlugin.getPluginDialogSettings();
filteredFilePath = dialogSettings.get(KEY_LOAD_SCHEMA_FILE + database.getId());
if (filteredFilePath == null || filteredFilePath.trim().length() == 0) {
filteredFilePath = database.getDatabaseInfo().getDbDir();
}
databaseNameText.setText(database.getLabel());
userNameText.setText(database.getUserName());
dbDir = database.getDatabaseInfo().getDbDir();
if (dbUnloadInfoList == null || dbUnloadInfoList.isEmpty()) {
selectLoadFileFromListButton.setSelection(false);
databaseCombo.setEnabled(false);
selectUnloadFileFromSysButton.setSelection(true);
} else {
int index = 0;
for (int i = 0; i < dbUnloadInfoList.size(); i++) {
DbUnloadInfo dbUnloadInfo = dbUnloadInfoList.get(i);
databaseCombo.add(dbUnloadInfo.getDbName());
if (dbUnloadInfo.getDbName().equals(database.getLabel())) {
index = i;
}
}
databaseCombo.select(index);
setTableModel(databaseCombo.getText());
selectUnloadFileFromSysButton.setSelection(false);
selectLoadFileFromListButton.setSelection(true);
setBtnStatusInList(true);
setBtnStatusInSys(false);
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project cubrid-manager by CUBRID.
the class CubridQueryUIPlugin method getPluginDialogSettings.
/**
*
* Get this plugin dialog settings
*
* @return IDialogSettings
*/
public static IDialogSettings getPluginDialogSettings() {
IDialogSettings dialogSettings = getDefault().getDialogSettings();
IDialogSettings pliginDialogSettings = dialogSettings.getSection(PLUGIN_ID);
if (pliginDialogSettings == null) {
return dialogSettings.addNewSection(PLUGIN_ID);
}
return pliginDialogSettings;
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class GenerateDocAsHTMLWizardPage method restoreWidgetValues.
/**
* Hook method for restoring widget values to the values that they held last time this wizard was used to
* completion.
*/
// protected void restoreWidgetValues() {
// IDialogSettings settings = getDialogSettings();
// if (settings != null) {
// String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
// if (directoryNames != null) {
// // destination
// setDestinationValue(directoryNames[0]);
// for (int i = 0; i < directoryNames.length; i++) {
// addDestinationItem(directoryNames[i]);
// }
// }
// }
// }
@Override
protected void restoreWidgetValues() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
boolean destinationValid = false;
if (directoryNames != null) {
// destination
boolean isFirstValid = false;
//$NON-NLS-1$
String filterName = ".zip";
//$NON-NLS-1$
String userDir = System.getProperty("user.dir");
IPath path = new Path(userDir).append(getDefaultFileName() + getOutputSuffix());
for (String directoryName : directoryNames) {
addDestinationItem(directoryName);
if (directoryName.substring(directoryName.lastIndexOf('.')).equalsIgnoreCase(filterName) && path.toOSString().equals(directoryName)) {
if (!isFirstValid) {
setDestinationValue(directoryName);
isFirstValid = true;
}
destinationValid = true;
}
}
}
if (!destinationValid || directoryNames == null) {
setDefaultDestination();
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class GenerateDocAsHTMLWizardPage method internalSaveWidgetValues.
/**
* Hook method for saving widget values for restoration by the next instance of this class.
*/
@Override
protected void internalSaveWidgetValues() {
// update directory names history
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames == null) {
directoryNames = new String[0];
}
directoryNames = addToHistory(directoryNames, getDestinationValue());
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class ToggleOrientationAction method refreshCheckState.
/**
* Refreshes the check state.
*/
private void refreshCheckState() {
IDialogSettings settings = Activator.getDefault().getDialogSettings(DIALOG_SETTINGS_NAME);
String key = sashForm.getClass().getCanonicalName();
String orientationString = settings.get(key);
if ((orientationString != null && Orientation.valueOf(orientationString) == orientation) || (orientationString == null && orientation == Orientation.AUTOMATIC)) {
setChecked(true);
}
}
Aggregations