use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class GenerateDocAsHTMLWizardPage method handleDestinationBrowseButtonPressed.
/**
* Open an appropriate destination browser so that the user can specify a source to import from.
*/
@Override
protected void handleDestinationBrowseButtonPressed() {
FileDialog dialog = new FileDialog(getContainer().getShell(), SWT.SAVE);
//$NON-NLS-1$ //$NON-NLS-2$
dialog.setFilterExtensions(new String[] { "*.zip", "*.*" });
//$NON-NLS-1$
dialog.setText("");
dialog.setFileName(getDefaultFileName());
String currentSourceString = getDestinationValue();
int lastSeparatorIndex = currentSourceString.lastIndexOf(File.separator);
if (lastSeparatorIndex != -1) {
dialog.setFilterPath(currentSourceString.substring(0, lastSeparatorIndex));
}
String selectedFileName = dialog.open();
if (selectedFileName != null) {
setErrorMessage(null);
setDestinationValue(selectedFileName);
if (getDialogSettings() != null) {
IDialogSettings section = getDialogSettings().getSection(DESTINATION_FILE);
if (section == null) {
section = getDialogSettings().addNewSection(DESTINATION_FILE);
}
section.put(DESTINATION_FILE, selectedFileName);
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class ExportItemWizard method addPages.
@Override
public void addPages() {
super.addPages();
mainPage = new ExportItemWizardPage(getWindowTitle(), selection, baseViewId);
addPage(mainPage);
AbstractUIPlugin plugin = (AbstractUIPlugin) Platform.getPlugin(PlatformUI.PLUGIN_ID);
IDialogSettings workbenchSettings = plugin.getDialogSettings();
//$NON-NLS-1$
IDialogSettings section = workbenchSettings.getSection("ExportItemWizard");
if (section == null) {
//$NON-NLS-1$
section = workbenchSettings.addNewSection("ExportItemWizard");
}
setDialogSettings(section);
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaPublishOnSpagoExportWizardPage method internalSaveWidgetValues.
/**
* Hook method for saving widget values for restoration by the next instance of this class.
*/
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());
settings.put(STORE_DESTINATION_NAMES_ID, directoryNames);
settings.put(STORE_SHELL_LAUNCHER_ID, true);
settings.put(STORE_SYSTEM_ROUTINE_ID, true);
settings.put(STORE_USER_ROUTINE_ID, true);
settings.put(STORE_MODEL_ID, true);
settings.put(STORE_JOB_ID, true);
settings.put(STORE_SOURCE_ID, false);
settings.put(STORE_CONTEXT_ID, contextButton.getSelection());
// settings.put(STORE_GENERATECODE_ID, genCodeButton.getSelection());
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaSpagicDeployWizardPage 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());
settings.put(STORE_DESTINATION_NAMES_ID, directoryNames);
settings.put(STORE_SHELL_LAUNCHER_ID, shellLauncherButton.getSelection());
settings.put(STORE_SYSTEM_ROUTINE_ID, systemRoutineButton.getSelection());
settings.put(STORE_USER_ROUTINE_ID, userRoutineButton.getSelection());
settings.put(STORE_MODEL_ID, modelButton.getSelection());
settings.put(STORE_JOB_ID, jobItemButton.getSelection());
settings.put(STORE_SOURCE_ID, jobScriptButton.getSelection());
settings.put(STORE_CONTEXT_ID, contextButton.getSelection());
settings.put(APPLY_TO_CHILDREN_ID, applyToChildrenButton.getSelection());
// settings.put(STORE_GENERATECODE_ID, genCodeButton.getSelection());
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaSpagicDeployWizardPage method restoreWidgetValues.
/**
* Hook method for restoring widget values to the values that they held last time this wizard was used to
* completion.
*/
@Override
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 (String directoryName : directoryNames) {
addDestinationItem(directoryName);
}
}
shellLauncherButton.setSelection(settings.getBoolean(STORE_SHELL_LAUNCHER_ID));
systemRoutineButton.setSelection(settings.getBoolean(STORE_SYSTEM_ROUTINE_ID));
userRoutineButton.setSelection(settings.getBoolean(STORE_USER_ROUTINE_ID));
modelButton.setSelection(settings.getBoolean(STORE_MODEL_ID));
jobItemButton.setSelection(settings.getBoolean(STORE_JOB_ID));
jobScriptButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
contextButton.setSelection(settings.getBoolean(STORE_CONTEXT_ID));
applyToChildrenButton.setSelection(settings.getBoolean(APPLY_TO_CHILDREN_ID));
// genCodeButton.setSelection(settings.getBoolean(STORE_GENERATECODE_ID));
}
launcherCombo.setItems(getManager().getLauncher());
if (getManager().getLauncher().length > 0) {
launcherCombo.select(0);
}
if (process.length > 0) {
try {
process[0].setProcess((ProcessItem) ProxyRepositoryFactory.getInstance().getUptodateProperty(process[0].getItem().getProperty()).getItem());
} catch (PersistenceException e) {
e.printStackTrace();
}
List<String> contextNames = getManager().getJobContextsComboValue((ProcessItem) process[0].getItem());
contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
if (contextNames.size() > 0) {
contextCombo.select(0);
}
}
}
Aggregations