use of org.eclipse.jface.dialogs.IDialogSettings in project tdi-studio-se by Talend.
the class JavaJobScriptsExportWSWizardPage method restoreWidgetValuesForWS.
protected void restoreWidgetValuesForWS() {
IDialogSettings settings = getDialogSettings();
if (settings != null) {
String[] directoryNames = settings.getArray(STORE_DESTINATION_NAMES_ID);
if (directoryNames != null && directoryNames.length > 0) {
String fileName = getDefaultFileNameWithType();
// destination
for (int i = 0; i < directoryNames.length; i++) {
if (directoryNames[i].toLowerCase().endsWith(FileConstants.WAR_FILE_SUFFIX) || directoryNames[i].toLowerCase().endsWith(FileConstants.ZIP_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 {
setDefaultDestination();
}
webXMLButton.setSelection(settings.getBoolean(STORE_WEBXML_ID));
configFileButton.setSelection(settings.getBoolean(STORE_CONFIGFILE_ID));
axisLibButton.setSelection(settings.getBoolean(STORE_AXISLIB_ID));
wsddButton.setSelection(settings.getBoolean(STORE_WSDD_ID));
wsdlButton.setSelection(settings.getBoolean(STORE_WSDL_ID));
jobScriptButton.setSelection(settings.getBoolean(STORE_SOURCE_ID));
contextButton.setSelection(settings.getBoolean(STORE_CONTEXT_ID));
applyToChildrenButton.setSelection(settings.getBoolean(APPLY_TO_CHILDREN_ID));
chkButton.setSelection(settings.getBoolean(EXTRACT_ZIP_FILE));
// TDI-26294:should use getVisible here since the isVisible need the parent's isVisible()
if (chkButton.getVisible()) {
zipOption = String.valueOf(chkButton.getSelection());
} else {
//$NON-NLS-1$
zipOption = "false";
}
}
if (getProcessItem() != null && contextCombo != null) {
try {
setProcessItem((ProcessItem) ProxyRepositoryFactory.getInstance().getUptodateProperty(getProcessItem().getProperty()).getItem());
} catch (PersistenceException e) {
e.printStackTrace();
}
List<String> contextNames = ExportJobUtil.getJobContexts(getProcessItem());
contextCombo.setItems(contextNames.toArray(new String[contextNames.size()]));
if (contextNames.size() > 0) {
contextCombo.select(0);
}
}
if (log4jLevelCombo != null) {
log4jLevelCombo.setItems(Log4jPrefsSettingManager.getLevel());
if (Log4jPrefsSettingManager.getLevel().length > 0) {
log4jLevelCombo.select(2);
}
}
}
use of org.eclipse.jface.dialogs.IDialogSettings in project translationstudio8 by heartsome.
the class ConversionWizardPage method createConversionOptionsGroup.
/**
* 转换选项组
* @param contents
* ;
*/
private void createConversionOptionsGroup(Composite contents) {
Group options = new Group(contents, SWT.NONE);
//$NON-NLS-1$
options.setText(Messages.getString("wizard.ConversionWizardPage.options"));
options.setLayout(new GridLayout(1, false));
options.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
/* 如果已经存在,是否要替换 */
final Button btnReplaceTarget = new Button(options, SWT.CHECK);
//$NON-NLS-1$
btnReplaceTarget.setText(Messages.getString("wizard.ConversionWizardPage.btnReplaceTarget"));
btnReplaceTarget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
btnReplaceTarget.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
isReplaceTarget = btnReplaceTarget.getSelection();
for (ConversionConfigBean conversionConfigBean : conversionConfigBeans) {
conversionConfigBean.setReplaceTarget(btnReplaceTarget.getSelection());
}
validate();
}
});
final Button btnOpenPreTrans = new Button(options, SWT.CHECK);
btnOpenPreTrans.setText(Messages.getString("wizard.ConversionWizardPage.btnOpenPreTrans"));
btnOpenPreTrans.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
btnOpenPreTrans.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
isOpenPreTrans = btnOpenPreTrans.getSelection();
}
});
Composite composite = new Composite(options, SWT.NONE);
GridLayout gd = new GridLayout(1, false);
gd.marginWidth = 0;
gd.marginHeight = 0;
composite.setLayout(gd);
composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
Label tgtLangLbl = new Label(composite, SWT.NONE);
tgtLangLbl.setText(Messages.getString("wizard.ConversionWizardPage.tgtLangLbl"));
tgtLangViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI);
Table tgtLangTable = tgtLangViewer.getTable();
GridData gdTgtLangTable = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
gdTgtLangTable.heightHint = 80;
tgtLangTable.setLayoutData(gdTgtLangTable);
tgtLangViewer.setLabelProvider(new LanguageLabelProvider());
tgtLangViewer.setContentProvider(new ArrayContentProvider());
tgtLangViewer.setInput(conversionConfigBeans.get(0).getTgtLangList());
tgtLangViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection sel = (IStructuredSelection) event.getSelection();
@SuppressWarnings("unchecked") List<Language> selectedList = sel.toList();
for (ConversionConfigBean conversionConfigBean : conversionConfigBeans) {
conversionConfigBean.setHasSelTgtLangList(selectedList);
}
validate();
}
});
tgtLangViewer.getTable().select(0);
IDialogSettings dialogSettings = Activator.getDefault().getDialogSettings();
btnReplaceTarget.setSelection(dialogSettings.getBoolean(REPLACE_TARGET));
btnOpenPreTrans.setSelection(dialogSettings.getBoolean(OPEN_PRE_TRANS));
this.isOpenPreTrans = btnOpenPreTrans.getSelection();
isReplaceTarget = btnReplaceTarget.getSelection();
for (ConversionConfigBean conversionConfigBean : conversionConfigBeans) {
conversionConfigBean.setReplaceTarget(isReplaceTarget);
}
validate();
}
use of org.eclipse.jface.dialogs.IDialogSettings in project cubrid-manager by CUBRID.
the class CommonUIPlugin method getPluginDialogSettings.
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 cubrid-manager by CUBRID.
the class FindReplaceDialog method getDialogSettings.
/**
* Retrieves the dialog settings.
*
* @return Dialog Settings
*/
private IDialogSettings getDialogSettings() {
IDialogSettings dialogSettings;
IDialogSettings settings = CUBRIDTextEditorPlugin.getDefault().getDialogSettings();
dialogSettings = settings.getSection(getClass().getName());
if (dialogSettings == null) {
dialogSettings = settings.addNewSection(getClass().getName());
}
//set default values.
if (dialogSettings.get("wrap") == null) {
//$NON-NLS-1$
dialogSettings.put("wrap", isWrapSearch());
//$NON-NLS-1$
dialogSettings.put("casesensitive", isCaseSensitive());
//$NON-NLS-1$
dialogSettings.put("wholeword", isWholeWord());
//$NON-NLS-1$
dialogSettings.put("incremental", isIncremental());
//$NON-NLS-1$
dialogSettings.put("isRegEx", isRegularExpressions());
}
return dialogSettings;
}
use of org.eclipse.jface.dialogs.IDialogSettings in project cubrid-manager by CUBRID.
the class FindReplaceDialog method writeConfiguration.
/**
* Stores its current configuration in the dialog store.
*/
private void writeConfiguration() {
IDialogSettings s = getDialogSettings();
//$NON-NLS-1$
s.put("wrap", isWrapSearch());
//$NON-NLS-1$
s.put("casesensitive", isCaseSensitive());
//$NON-NLS-1$
s.put("wholeword", isWholeWord());
//$NON-NLS-1$
s.put("incremental", isIncremental());
//$NON-NLS-1$
s.put("isRegEx", isRegularExpressions());
List<String> history = getFindHistory();
//$NON-NLS-1$
writeHistory(history, s, "findhistory");
history = getReplaceHistory();
//$NON-NLS-1$
writeHistory(history, s, "replacehistory");
}
Aggregations