use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class OverviewSection method storeTreeExpansionState.
/**
* Stores the tree expansion state of given tree items.
*
* @param items The tree items
*/
private void storeTreeExpansionState(TreeItem[] items) {
IDialogSettings settings = getDialogSettings();
for (TreeItem item : items) {
if (item.getItems().length > 0) {
settings.put(item.getText(), item.getExpanded());
storeTreeExpansionState(item.getItems());
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class OverviewSection method restoreTreeExpansionState.
/**
* Restores the tree expansion state of given tree items.
*
* @param items The tree items
*/
private void restoreTreeExpansionState(TreeItem[] items) {
IDialogSettings settings = getDialogSettings();
for (TreeItem item : items) {
if (item.getItems().length > 0) {
boolean expanded = settings.getBoolean(item.getText());
item.setExpanded(expanded);
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaJobScriptsExportWSWizardPage method restoreWidgetValuesForOSGI.
protected void restoreWidgetValuesForOSGI() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames != null && directoryNames.length > 0) {
String fileName = getDefaultFileNameWithType();
for (int i = 0; i < directoryNames.length; i++) {
if (directoryNames[i].toLowerCase().endsWith(FileConstants.JAR_FILE_SUFFIX)) {
//$NON-NLS-1$
directoryNames[i] = (directoryNames[i].charAt(0) + "").toUpperCase() + directoryNames[i].substring(1);
addDestinationItem(directoryNames[i]);
}
}
File dest = new File(new File(directoryNames[0]).getParentFile(), fileName);
setDestinationValue(dest.getAbsolutePath());
} else {
setDefaultDestinationForOSGI();
}
} else {
setDefaultDestinationForOSGI();
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaJobScriptsExportWSWizardPage method internalSaveWidgetValues.
@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];
}
String destinationValue = getDestinationValue();
directoryNames = addToHistory(directoryNames, destinationValue);
// String[] directoryNames = new String[1];
// String destinationValue = getDestinationValue();
// if (destinationValue != null) {
// destinationValue = destinationValue.substring(0, destinationValue.lastIndexOf(File.separator));
// }
// directoryNames[0] = destinationValue;
settings.put(STORE_EXPORTTYPE_ID, getCurrentExportType1().toString());
settings.put(STORE_DESTINATION_NAMES_ID, directoryNames);
if (getCurrentExportType1().equals(JobExportType.OSGI)) {
return;
}
if (contextButton != null) {
settings.put(STORE_CONTEXT_ID, contextButton.getSelection());
}
if (jobScriptButton != null && !jobScriptButton.isDisposed()) {
settings.put(STORE_SOURCE_ID, jobScriptButton.getSelection());
}
if (applyToChildrenButton != null) {
settings.put(APPLY_TO_CHILDREN_ID, applyToChildrenButton.getSelection());
}
if (jobItemButton != null && !jobItemButton.isDisposed()) {
settings.put(STORE_JOB_ID, jobItemButton.getSelection());
}
if (log4jLevelCombo != null && !log4jLevelCombo.isDisposed()) {
settings.put(LOG4J_LEVEL_ID, log4jLevelCombo.getText());
}
if (getCurrentExportType1().equals(JobExportType.POJO)) {
settings.put(STORE_SHELL_LAUNCHER_ID, shellLauncherButton.getSelection());
settings.put(EXTRACT_ZIP_FILE, chkButton.getSelection());
return;
} else if (getCurrentExportType1().equals(JobExportType.WSZIP)) {
settings.put(STORE_WEBXML_ID, webXMLButton.getSelection());
settings.put(STORE_CONFIGFILE_ID, configFileButton.getSelection());
settings.put(STORE_AXISLIB_ID, axisLibButton.getSelection());
settings.put(STORE_WSDD_ID, wsddButton.getSelection());
settings.put(STORE_WSDL_ID, wsdlButton.getSelection());
settings.put(EXTRACT_ZIP_FILE, chkButton.getSelection());
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class ImportProjectsAction method run.
public void run() {
ExternalProjectImportWizard processWizard = new TalendExternalProjectImportWizard();
// Set the "Copy projects into workspace" value default as true:
IDialogSettings dialogSettings = processWizard.getDialogSettings();
if (dialogSettings.get(STORE_COPY_PROJECT) == null) {
dialogSettings.put(STORE_COPY_PROJECT, true);
}
Shell activeShell = Display.getCurrent().getActiveShell();
WizardDialog dialog = new WizardDialog(activeShell, processWizard);
processWizard.setWindowTitle(ACTION_TITLE);
dialog.create();
dialog.open();
}
Aggregations