use of org.eclipse.jface.preference.IntegerFieldEditor in project tdi-studio-se by Talend.
the class ComponentsPreferencePage method addFontAndColorFieldsForDataViewer.
protected void addFontAndColorFieldsForDataViewer(Composite composite) {
IntegerFieldEditor rowLimit = new IntegerFieldEditor(IComponentPreferenceConstant.LIMIT, Messages.getString("ComponentsPreferencePage.rowLimit"), //$NON-NLS-1$
composite);
rowLimit.setValidRange(1, 1000);
addField(rowLimit);
Text textControl = rowLimit.getTextControl(composite);
GridData layoutData = new GridData();
layoutData.widthHint = 200;
textControl.setLayoutData(layoutData);
}
use of org.eclipse.jface.preference.IntegerFieldEditor in project tdi-studio-se by Talend.
the class PerformancePreferencePage method addSVNInforAutoCheckFiled.
private void addSVNInforAutoCheckFiled() {
if (PluginChecker.isSVNProviderPluginLoaded()) {
final CheckBoxFieldEditor autoCheckField = new CheckBoxFieldEditor(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK, Messages.getString("PerformancePreferencePage.autoCheckField"), //$NON-NLS-1$
getFieldEditorParent());
addField(autoCheckField);
final IntegerFieldEditor autoCheckTime = new IntegerFieldEditor(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK_TIME_INTERVAL, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.autoCheckTime"), getFieldEditorParent());
autoCheckTime.setValidRange(1, 30);
autoCheckTime.setEnabled(getPreferenceStore().getBoolean(ITalendCorePrefConstants.SVN_UPDATE_INFO_AUTO_CHECK), getFieldEditorParent());
addField(autoCheckTime);
autoCheckField.getButton().addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (autoCheckField.getButton().getSelection()) {
autoCheckTime.setEnabled(true, getFieldEditorParent());
} else {
autoCheckTime.setEnabled(false, getFieldEditorParent());
}
}
});
final CheckBoxFieldEditor autoRefreshLocksField = new CheckBoxFieldEditor(ITalendCorePrefConstants.AUTO_REFRESH_LOCKS, Messages.getString("PerformancePreferencePage.autoRefreshLocksField"), //$NON-NLS-1$
getFieldEditorParent());
addField(autoRefreshLocksField);
final IntegerFieldEditor tacConnectionTimeout = new IntegerFieldEditor(ITalendCorePrefConstants.PERFORMANCE_TAC_CONNECTION_TIMEOUT, //$NON-NLS-1$
Messages.getString("PerformancePreferencePage.tacTimeout"), getFieldEditorParent());
autoCheckTime.setValidRange(0, 3600);
addField(tacConnectionTimeout);
}
}
use of org.eclipse.jface.preference.IntegerFieldEditor in project tdi-studio-se by Talend.
the class RunProcessPreferencePage method createFieldEditors.
/**
* DOC chuang Comment method "addConsoleFont".
*/
// private void addConsoleFont() {
// Group group = new Group(parent, SWT.NONE);
// group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
// group.setLayout(new GridLayout(1, false));
// group.setText(Messages.getString("RunProcessPreferencePage.outputConsole")); //$NON-NLS-1$
//
// Composite composite = new Composite(group, SWT.NONE);
// composite.setLayout(new GridLayout(3, false));
// GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
// gridData.grabExcessHorizontalSpace = true;
// gridData.horizontalSpan = 3;
// composite.setLayoutData(gridData);
// consoleFontField = new FontFieldEditor(RunProcessPrefsConstants.CONSOLE_FONT, Messages
// .getString("RunProcessPreferencePage.consoleFont"), composite); //$NON-NLS-1$
//
// }
/**
* Create all field editors for this page.
*/
@Override
public void createFieldEditors() {
parent = new Composite(getFieldEditorParent(), SWT.NONE);
GridLayout gridLayout = new GridLayout(1, false);
gridLayout.marginBottom = 0;
gridLayout.marginWidth = 0;
gridLayout.marginTop = 0;
gridLayout.marginRight = 0;
gridLayout.marginLeft = 0;
gridLayout.marginHeight = 0;
parent.setLayout(gridLayout);
GridData gridData = new GridData(GridData.FILL_BOTH);
parent.setLayoutData(gridData);
clientGroup = new Group(parent, SWT.NONE);
//$NON-NLS-1$
clientGroup.setText(Messages.getString("prefs.clientConfiguration"));
GridLayout layout = new GridLayout();
layout.numColumns = 1;
clientGroup.setLayout(layout);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
clientGroup.setLayoutData(gd);
// /////////////////////////////////////////////////////////////////////////////
// CLIENT_STATS_PORTS
Composite compositeStatsPorts = new Composite(clientGroup, SWT.NONE);
compositeStatsPorts.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeStatsPorts.setLayout(gridLayout);
Composite compositeStatsPort1 = new Composite(compositeStatsPorts, SWT.NONE);
compositeStatsPort1.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeStatsPort1.setLayout(gridLayout);
fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_STATS_PORT_BOUND1, Messages.getString("prefs.clientStatsPortBound1"), //$NON-NLS-1$
compositeStatsPort1);
addField(fClientStatPortEditor);
fClientStatPortEditor.setValidRange(1024, 65535);
//$NON-NLS-1$
fClientStatPortEditor.setErrorMessage(Messages.getString("runProcessRemote.clientStatInvalidRange"));
Composite compositeStatsPort2 = new Composite(compositeStatsPorts, SWT.NONE);
compositeStatsPort2.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeStatsPort2.setLayout(gridLayout);
fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_STATS_PORT_BOUND2, Messages.getString("prefs.clientStatsPortBound2"), //$NON-NLS-1$
compositeStatsPort2);
addField(fClientStatPortEditor);
fClientStatPortEditor.setValidRange(1024, 65535);
//$NON-NLS-1$
fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
// /////////////////////////////////////////////////////////////////////////////
// /////////////////////////////////////////////////////////////////////////////
// CLIENT_TRACE_PORTS
Composite compositeTracePorts = new Composite(clientGroup, SWT.NONE);
compositeTracePorts.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeTracePorts.setLayout(gridLayout);
Composite compositeTracePorts1 = new Composite(compositeTracePorts, SWT.NONE);
compositeTracePorts1.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeTracePorts1.setLayout(gridLayout);
fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_TRACE_PORT_BOUND1, Messages.getString("prefs.clientTracePortBound1"), //$NON-NLS-1$
compositeTracePorts1);
addField(fClientStatPortEditor);
fClientStatPortEditor.setValidRange(1024, 65535);
//$NON-NLS-1$
fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
Composite compositeTracePort2 = new Composite(compositeTracePorts, SWT.NONE);
compositeTracePort2.setLayoutData(new GridData(GridData.FILL_BOTH));
gridLayout = new GridLayout(2, true);
compositeTracePort2.setLayout(gridLayout);
fClientStatPortEditor = new IntegerFieldEditor(RunProcessPrefsConstants.CLIENT_TRACE_PORT_BOUND2, Messages.getString("prefs.clientTracePortBound2"), //$NON-NLS-1$
compositeTracePort2);
addField(fClientStatPortEditor);
fClientStatPortEditor.setValidRange(1024, 65535);
//$NON-NLS-1$
fClientStatPortEditor.setErrorMessage(Messages.getString("prefs.clientStatInvalidRange"));
// /////////////////////////////////////////////////////////////////////////////
Composite compositeStateTraceRun = new Composite(clientGroup, SWT.NONE);
compositeStateTraceRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutStateTraceRun = new GridLayout(3, true);
compositeStateTraceRun.setLayout(gridLayoutStateTraceRun);
Composite compositeSaveBeforeRun = new Composite(compositeStateTraceRun, SWT.NONE);
compositeSaveBeforeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutSaveBeforeRun = new GridLayout(1, true);
compositeSaveBeforeRun.setLayout(gridLayoutSaveBeforeRun);
onSavebeforeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISSAVEBEFORERUN, //$NON-NLS-1$
Messages.getString("RunProcessPreferencePage.save"), //$NON-NLS-1$
SWT.NONE, compositeSaveBeforeRun);
addField(onSavebeforeField);
Composite compositeClearBeforeRun = new Composite(compositeStateTraceRun, SWT.NONE);
compositeClearBeforeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutClearBeforeRun = new GridLayout(1, true);
compositeClearBeforeRun.setLayout(gridLayoutClearBeforeRun);
onClearbeforeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISCLEARBEFORERUN, //$NON-NLS-1$
Messages.getString("RunProcessPreferencePage.clear"), //$NON-NLS-1$
SWT.NONE, compositeClearBeforeRun);
addField(onClearbeforeField);
Composite compositeExecTimeRun = new Composite(compositeStateTraceRun, SWT.NONE);
compositeExecTimeRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutExecTimeRun = new GridLayout(1, true);
compositeExecTimeRun.setLayout(gridLayoutExecTimeRun);
onExecTimeField = new BooleanFieldEditor(RunProcessPrefsConstants.ISEXECTIMERUN, //$NON-NLS-1$
Messages.getString("RunProcessPreferencePage.execTime"), //$NON-NLS-1$
SWT.NONE, compositeExecTimeRun);
addField(onExecTimeField);
Composite compositeStatisticsRun = new Composite(compositeStateTraceRun, SWT.NONE);
compositeStatisticsRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutStatisticsRun = new GridLayout(1, true);
compositeStatisticsRun.setLayout(gridLayoutStatisticsRun);
onStatisticsField = new BooleanFieldEditor(RunProcessPrefsConstants.ISSTATISTICSRUN, //$NON-NLS-1$
Messages.getString("RunProcessPreferencePage.statistics"), //$NON-NLS-1$
SWT.NONE, compositeStatisticsRun);
addField(onStatisticsField);
Composite compositeTracesRun = new Composite(compositeStateTraceRun, SWT.NONE);
compositeTracesRun.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutTracesRun = new GridLayout(1, false);
compositeTracesRun.setLayout(gridLayoutTracesRun);
onTracesField = new BooleanFieldEditor(RunProcessPrefsConstants.ISTRACESRUN, Messages.getString("RunProcessPreferencePage.traces"), SWT.NONE, //$NON-NLS-1$
compositeTracesRun);
addField(onTracesField);
Composite compositeTracesTime = new Composite(compositeStateTraceRun, SWT.NONE);
compositeTracesTime.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutTracesTime = new GridLayout(1, false);
compositeTracesTime.setLayout(gridLayoutTracesTime);
tracesTime = new IntegerFieldEditor(RunProcessPrefsConstants.STRACESTIME, Messages.getString("RunProcessPreferencePage.pauseTime"), //$NON-NLS-1$
compositeTracesTime);
addField(tracesTime);
// 0004895: Font size of the output console are very small
// addConsoleFont();
Composite argumentsComposite = new Composite(parent, SWT.NONE);
argumentsComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
GridLayout gridLayoutArguments = new GridLayout(1, false);
argumentsComposite.setLayout(gridLayoutArguments);
String text = "RunProcessPreferencePage.vmArgument";
IBrandingService breaningService = (IBrandingService) GlobalServiceRegister.getDefault().getService(IBrandingService.class);
if (breaningService.isPoweredOnlyCamel()) {
text = "RunProcessPreferencePage.RouteVmArgument";
}
VMArgumentsViewer argumentsViewer = new //$NON-NLS-1$
VMArgumentsViewer(//$NON-NLS-1$
RunProcessPrefsConstants.VMARGUMENTS, //$NON-NLS-1$
Messages.getString(text), argumentsComposite);
addField(argumentsViewer);
manager = ProcessManager.getInstance();
}
use of org.eclipse.jface.preference.IntegerFieldEditor in project tesb-studio-se by Talend.
the class RunContainerPreferencePage method createPageContents.
/**
* Create contents of the preference page.
*
* @param parent
*/
@Override
public Control createPageContents(Composite parent) {
serverFieldEditors = new ArrayList<FieldEditor>();
optionFieldEditors = new ArrayList<FieldEditor>();
runtimeEnable = getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
GridLayout gridLayoutDefault = new GridLayout(1, false);
Composite body = new Composite(parent, SWT.NONE);
body.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
body.setLayout(gridLayoutDefault);
getPreferenceStore().getBoolean(RunContainerPreferenceInitializer.P_ESB_IN_OSGI);
useOSGiEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_IN_OSGI, "ESB Studio Runtime - Use Local Talend Runtime (OSGi Container)", body);
addField(useOSGiEditor);
Label lblNote = new Label(body, SWT.WRAP);
lblNote.setText("Note: It will be only taken into account for an ESB Artifact:\n" + " · A Route (Any Route)\n" + " · A DataService (SOAP/REST)\n" + " · A Job contains tRESTClient or tESBConsumer component");
Group groupServer = new Group(body, SWT.NONE);
//$NON-NLS-1$
groupServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group1"));
groupServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
groupServer.setLayout(new GridLayout(2, false));
compositeServerBody = new Composite(groupServer, SWT.BORDER);
compositeServerBody.setLayout(gridLayoutDefault);
compositeServerBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
StringFieldEditor locationEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_LOCATION, RunContainerMessages.getString("RunContainerPreferencePage.Location"), //$NON-NLS-1$
compositeServerBody);
addField(locationEditor);
serverFieldEditors.add(locationEditor);
StringFieldEditor hostFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_HOST, RunContainerMessages.getString("RunContainerPreferencePage.Host"), compositeServerBody);
addField(hostFieldEditor);
// only support local runtime server, if need support remote server ,enable this editor
hostFieldEditor.setEnabled(false, compositeServerBody);
StringFieldEditor userFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_USERNAME, RunContainerMessages.getString("RunContainerPreferencePage.Username"), //$NON-NLS-1$
compositeServerBody);
addField(userFieldEditor);
serverFieldEditors.add(userFieldEditor);
StringFieldEditor passwordFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PASSWORD, RunContainerMessages.getString("RunContainerPreferencePage.Password"), //$NON-NLS-1$
compositeServerBody);
addField(passwordFieldEditor);
serverFieldEditors.add(passwordFieldEditor);
StringFieldEditor instanceFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_INSTANCE, RunContainerMessages.getString("RunContainerPreferencePage.Instance"), //$NON-NLS-1$
compositeServerBody);
addField(instanceFieldEditor);
serverFieldEditors.add(instanceFieldEditor);
IntegerFieldEditor portFieldEditor = new IntegerFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_PORT, RunContainerMessages.getString("RunContainerPreferencePage.Port"), //$NON-NLS-1$
compositeServerBody);
addField(portFieldEditor);
serverFieldEditors.add(portFieldEditor);
StringFieldEditor jmxPortFieldEditor = new StringFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_JMX_PORT, RunContainerMessages.getString("RunContainerPreferencePage.JMXPort"), //$NON-NLS-1$
compositeServerBody);
addField(jmxPortFieldEditor);
serverFieldEditors.add(jmxPortFieldEditor);
Composite compBtn = new Composite(groupServer, SWT.NONE);
GridData gridDataBtn = new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1);
gridDataBtn.widthHint = 100;
compBtn.setLayoutData(gridDataBtn);
GridLayout layoutCompBtn = new GridLayout(1, false);
layoutCompBtn.marginWidth = 0;
layoutCompBtn.marginHeight = 0;
compBtn.setLayout(layoutCompBtn);
buttonAddServer = new Button(compBtn, SWT.NONE);
buttonAddServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
buttonAddServer.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
AddRuntimeWizard dirWizard = new AddRuntimeWizard(locationEditor.getStringValue());
dirWizard.setNeedsProgressMonitor(true);
WizardDialog wizardDialog = new WizardDialog(getShell(), dirWizard);
if (wizardDialog.open() == Window.OK) {
locationEditor.setStringValue(dirWizard.getTarget());
}
}
});
//$NON-NLS-1$
buttonAddServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.ServerButton"));
// Button btnTestConnection = new Button(compBtn, SWT.NONE);
// btnTestConnection.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
// btnTestConnection.setText("Server Info...");
buttonInitalizeServer = new Button(compBtn, SWT.NONE);
buttonInitalizeServer.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//$NON-NLS-1$
buttonInitalizeServer.setText(RunContainerMessages.getString("RunContainerPreferencePage.InitalizeButton"));
buttonInitalizeServer.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (initalizeRuntime(locationEditor.getStringValue(), hostFieldEditor.getStringValue())) {
try {
new InitFinishMessageDialog(getShell(), JMXUtil.getBundlesName()).open();
} catch (Exception ex) {
ex.printStackTrace();
}
}
}
});
Group groupOption = new Group(body, SWT.NONE);
groupOption.setLayout(gridLayoutDefault);
groupOption.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
//$NON-NLS-1$
groupOption.setText(RunContainerMessages.getString("RunContainerPreferencePage.Group2"));
compositeOptionBody = new Composite(groupOption, SWT.NONE);
compositeOptionBody.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
BooleanFieldEditor filterLogEditor = new BooleanFieldEditor(RunContainerPreferenceInitializer.P_ESB_RUNTIME_SYS_LOG, RunContainerMessages.getString("RunContainerPreferencePage.FilterLogs"), //$NON-NLS-1$
compositeOptionBody);
addField(filterLogEditor);
optionFieldEditors.add(filterLogEditor);
manager = ProcessManager.getInstance();
return body;
}
use of org.eclipse.jface.preference.IntegerFieldEditor in project tdi-studio-se by Talend.
the class PaletteSettingsPreferencePage method createFieldEditors.
@Override
protected void createFieldEditors() {
recentlyUsedListSize = new IntegerFieldEditor(TalendDesignerPrefConstants.PALETTE_SETTINGS_RECENTLY_USED_LIST_SIZE, //$NON-NLS-1$
Messages.getString("PaletteSettingsPreferencePage.paletteSettingsRecentlyUsedListSize"), getFieldEditorParent());
recentlyUsedListSize.setValidRange(1, 1000);
addField(recentlyUsedListSize);
shouldSearchFromHelp = new CheckBoxFieldEditor(TalendDesignerPrefConstants.PALETTE_SETTINGS_SEARCH_FROM_HELP, //$NON-NLS-1$
Messages.getString("PaletteSettingsPreferencePage.paletteSettingsSearchFromHelp"), getFieldEditorParent());
addField(shouldSearchFromHelp);
resultLimitFromHelp = new IntegerFieldEditor(TalendDesignerPrefConstants.PALETTE_SETTINGS_SEARCH_RESULT_LIMIT_FROM_HELP, //$NON-NLS-1$
Messages.getString("PaletteSettingsPreferencePage.paletteSettingsSearchResultLimitFromHelp"), getFieldEditorParent());
resultLimitFromHelp.setValidRange(1, 1000);
addField(resultLimitFromHelp);
initStatus();
initListeners();
}
Aggregations