List of usage examples for org.eclipse.jface.dialogs IDialogConstants OK_ID
int OK_ID
To view the source code for org.eclipse.jface.dialogs IDialogConstants OK_ID.
Click Source Link
From source file:com.clustercontrol.jobmanagement.composite.JobCommandParameterComposite.java
License:Open Source License
/** * ????/*from w w w .j a v a2 s . c om*/ */ private void initialize() { this.setLayout(JobDialogUtil.getParentLayout()); // Table table = new Table(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); WidgetTestUtil.setTestId(this, "table", table); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(new RowData(430, 75)); // Composite Composite buttonComposite = new Composite(this, SWT.NONE); buttonComposite.setLayout(new RowLayout()); // dummy new Label(buttonComposite, SWT.NONE).setLayoutData(new RowData(190, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_btnAdd = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnAdd", this.m_btnAdd); this.m_btnAdd.setText(Messages.getString("add")); this.m_btnAdd.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnAdd.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { JobCommandParameterDialog dialog = new JobCommandParameterDialog(m_shell); if (dialog.open() == IDialogConstants.OK_ID) { if (isParameterDuplicate(dialog.getInputData().getParamId())) { // ???? MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.134")); } else { m_jobCommandParamMap.put(dialog.getInputData().getParamId(), dialog.getInputData()); reflectParamInfo(); } } } }); // this.m_btnModify = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnModify", this.m_btnModify); this.m_btnModify.setText(Messages.getString("modify")); this.m_btnModify.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnModify.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); JobCommandParameterDialog dialog = new JobCommandParameterDialog(m_shell, m_jobCommandParamMap.get(paramId)); if (dialog.open() == IDialogConstants.OK_ID) { m_jobCommandParamMap.put(paramId, (JobCommandParam) dialog.getInputData()); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // this.m_btnDelete = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnDelete", this.m_btnDelete); this.m_btnDelete.setText(Messages.getString("delete")); this.m_btnDelete.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnDelete.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); if (paramId == null) { paramId = ""; } String[] args = { paramId }; if (MessageDialog.openConfirm(null, Messages.getString("confirmed"), Messages.getString("message.job.130", args))) { m_jobCommandParamMap.remove(paramId); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); this.m_viewer = new CommonTableViewer(table); this.m_viewer.createTableColumn(GetCommandParameterTableDefine.get(), GetCommandParameterTableDefine.SORT_COLUMN_INDEX, GetCommandParameterTableDefine.SORT_ORDER); this.m_viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { if (m_btnAdd.isEnabled()) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); JobCommandParameterDialog dialog = new JobCommandParameterDialog(m_shell, m_jobCommandParamMap.get(paramId)); if (dialog.open() == IDialogConstants.OK_ID) { m_jobCommandParamMap.put(paramId, dialog.getInputData()); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } } }); }
From source file:com.clustercontrol.jobmanagement.composite.JobKickFileCheckComposite.java
License:Open Source License
/** * ?????/*w w w. j a va 2 s . com*/ */ private void initialize() { this.m_shell = this.getShell(); Label label = null; this.setLayout(JobDialogUtil.getParentLayout()); // ?Composite Composite composite = new Composite(this, SWT.NONE); composite.setLayout(new GridLayout(3, false)); composite.setLayoutData(new RowData()); ((RowData) composite.getLayoutData()).width = 525; // label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(150, SizeConstant.SIZE_LABEL_HEIGHT)); label.setText(Messages.getString("scope") + " : "); // this.m_txtScope = new Text(composite, SWT.READ_ONLY | SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtScope", this.m_txtScope); this.m_txtScope.setLayoutData(new GridData(200, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtScope.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ? this.m_btnScopeSelect = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnScopeSelect", this.m_btnScopeSelect); this.m_btnScopeSelect.setLayoutData(new GridData(40, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnScopeSelect.setText(Messages.getString("refer")); this.m_btnScopeSelect.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ScopeTreeDialog dialog = new ScopeTreeDialog(m_shell, m_managerName, m_ownerRoleId); if (dialog.open() == IDialogConstants.OK_ID) { FacilityTreeItem selectItem = dialog.getSelectItem(); FacilityInfo info = selectItem.getData(); FacilityPath path = new FacilityPath(ClusterControlPlugin.getDefault().getSeparator()); m_facilityId = info.getFacilityId(); m_txtScope.setText(path.getPath(selectItem)); update(); } } }); // label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(150, SizeConstant.SIZE_LABEL_HEIGHT)); label.setText(Messages.getString("file.check.directory") + " : "); // this.m_txtDirectory = new Text(composite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtDirectory", this.m_txtDirectory); this.m_txtDirectory.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_1024)); this.m_txtDirectory.setLayoutData(new GridData(200, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtDirectory.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(composite, SWT.NONE); // ?? label = new Label(composite, SWT.NONE); label.setLayoutData(new GridData(150, SizeConstant.SIZE_LABEL_HEIGHT)); label.setText(Messages.getString("file.name") + "(" + Messages.getString("regex") + ") : "); // ?? this.m_txtFileName = new Text(composite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtFileName", this.m_txtFileName); this.m_txtFileName.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_64)); this.m_txtFileName.setLayoutData(new GridData(200, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtFileName.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(composite, SWT.NONE); // separator JobDialogUtil.getSeparator(this); // ? Group checkGroup = new Group(composite, SWT.NONE); checkGroup.setLayoutData(new GridData()); ((GridData) checkGroup.getLayoutData()).horizontalSpan = 3; checkGroup.setLayout(new GridLayout(2, false)); checkGroup.setText(Messages.getString("file.check.type") + " : "); // ?? this.m_btnTypeCreate = new Button(checkGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnTypeCreate", this.m_btnTypeCreate); this.m_btnTypeCreate.setText(Messages.getString("create")); this.m_btnTypeCreate.setLayoutData(new GridData(70, SizeConstant.SIZE_BUTTON_HEIGHT)); ((GridData) this.m_btnTypeCreate.getLayoutData()).verticalAlignment = SWT.BEGINNING; this.m_btnTypeCreate.setSelection(true); this.m_btnTypeCreate.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // dummy new Label(checkGroup, SWT.NONE); // ? this.m_btnTypeDelete = new Button(checkGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnTypeDelete", this.m_btnTypeDelete); this.m_btnTypeDelete.setText(Messages.getString("delete")); this.m_btnTypeDelete.setLayoutData(new GridData(70, SizeConstant.SIZE_BUTTON_HEIGHT)); ((GridData) this.m_btnTypeDelete.getLayoutData()).verticalAlignment = SWT.BEGINNING; this.m_btnTypeDelete.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // dummy new Label(checkGroup, SWT.NONE); // ? this.m_btnTypeModify = new Button(checkGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnTypeModify", this.m_btnTypeModify); this.m_btnTypeModify.setText(Messages.getString("modify")); this.m_btnTypeModify.setLayoutData(new GridData(70, SizeConstant.SIZE_BUTTON_HEIGHT)); ((GridData) this.m_btnTypeModify.getLayoutData()).verticalAlignment = SWT.BEGINNING; this.m_btnTypeModify.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // Composite Composite modifyTypeComposite = new Composite(checkGroup, SWT.BORDER); modifyTypeComposite.setLayout(new GridLayout(2, false)); // this.m_btnTypeTimeStamp = new Button(modifyTypeComposite, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnTypeTimeStamp", this.m_btnTypeTimeStamp); this.m_btnTypeTimeStamp.setText(Messages.getString("file.check.type.modify.timestamp")); this.m_btnTypeTimeStamp.setLayoutData(new GridData(150, SizeConstant.SIZE_BUTTON_HEIGHT)); ((GridData) this.m_btnTypeTimeStamp.getLayoutData()).horizontalAlignment = GridData.CENTER; this.m_btnTypeTimeStamp.setSelection(true); this.m_btnTypeTimeStamp.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // this.m_btnTypeFileSize = new Button(modifyTypeComposite, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnTypeFileSize", this.m_btnTypeFileSize); this.m_btnTypeFileSize.setText(Messages.getString("file.check.type.modify.file.size")); this.m_btnTypeFileSize.setLayoutData(new GridData(150, SizeConstant.SIZE_BUTTON_HEIGHT)); ((GridData) this.m_btnTypeFileSize.getLayoutData()).horizontalAlignment = GridData.CENTER; this.m_btnTypeFileSize.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // ? this.m_btnTypeCreate.setSelection(true); this.m_btnTypeTimeStamp.setSelection(true); }
From source file:com.clustercontrol.jobmanagement.composite.JobKickParamComposite.java
License:Open Source License
/** * ????//www . ja va 2 s . com */ private void initialize() { m_shell = this.getShell(); this.setLayout(JobDialogUtil.getParentLayout()); // Composite Composite composite = new Composite(this, SWT.NONE); composite.setLayout(new GridLayout(4, false)); composite.setLayoutData(new RowData()); ((RowData) composite.getLayoutData()).width = 525; // Table table = new Table(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); WidgetTestUtil.setTestId(this, "table", table); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(new GridData(465, 150)); ((GridData) table.getLayoutData()).horizontalSpan = 4; // dummy new Label(composite, SWT.NONE).setLayoutData(new GridData(325, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_btnAdd = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnAdd", this.m_btnAdd); this.m_btnAdd.setText(Messages.getString("add")); this.m_btnAdd.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnAdd.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { RuntimeParameterDialog dialog = new RuntimeParameterDialog(m_shell, m_jobRuntimeParamMap); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParamMap.put(dialog.getInputData().getParamId(), dialog.getInputData()); reflectParamInfo(); } } }); // this.m_btnModify = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnModify", this.m_btnModify); this.m_btnModify.setText(Messages.getString("modify")); this.m_btnModify.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnModify.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); RuntimeParameterDialog dialog = new RuntimeParameterDialog(m_shell, m_jobRuntimeParamMap, m_jobRuntimeParamMap.get(paramId)); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParamMap.remove(paramId); m_jobRuntimeParamMap.put(dialog.getInputData().getParamId(), dialog.getInputData()); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // this.m_btnDelete = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnDelete", this.m_btnDelete); this.m_btnDelete.setText(Messages.getString("delete")); this.m_btnDelete.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnDelete.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); if (paramId == null) { paramId = ""; } String[] args = { paramId }; if (MessageDialog.openConfirm(null, Messages.getString("confirmed"), Messages.getString("message.job.130", args))) { m_jobRuntimeParamMap.remove(paramId); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); this.m_viewer = new CommonTableViewer(table); this.m_viewer.createTableColumn(GetJobKickParameterTableDefine.get(), GetJobKickParameterTableDefine.SORT_COLUMN_INDEX, GetJobKickParameterTableDefine.SORT_ORDER); this.m_viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { int order = m_viewer.getTable().getSelectionIndex(); if (order >= 0) { String paramId = (String) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()) .get(0); RuntimeParameterDialog dialog = new RuntimeParameterDialog(m_shell, m_jobRuntimeParamMap, m_jobRuntimeParamMap.get(paramId)); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParamMap.remove(paramId); m_jobRuntimeParamMap.put(dialog.getInputData().getParamId(), dialog.getInputData()); reflectParamInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); }
From source file:com.clustercontrol.jobmanagement.composite.JobTreeComposite.java
License:Open Source License
/** * ????/*from w w w.ja va 2s. co m*/ */ protected void initialize() { GridLayout layout = new GridLayout(1, true); this.setLayout(layout); layout.marginHeight = 0; layout.marginWidth = 0; // Add search bar Composite compSearch = new TreeSearchBarComposite(this, SWT.NONE, enableKeyPress); WidgetTestUtil.setTestId(this, "search", compSearch); compSearch.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); Tree tree = new Tree(this, SWT.MULTI | SWT.BORDER); WidgetTestUtil.setTestId(this, null, tree); GridData gridData = new GridData(); gridData.horizontalAlignment = GridData.FILL; gridData.verticalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; gridData.grabExcessVerticalSpace = true; tree.setLayoutData(gridData); m_viewer = new JobTreeViewer(tree); m_viewer.setContentProvider(new JobTreeContentProvider()); m_viewer.setLabelProvider(new JobTreeLabelProvider(m_useForView)); // ?? m_viewer.addSelectionChangedListener(new ISelectionChangedListener() { @SuppressWarnings("unchecked") @Override public void selectionChanged(SelectionChangedEvent event) { StructuredSelection selection = (StructuredSelection) event.getSelection(); m_selectItemList.clear(); m_selectItemList.addAll(selection.toList()); } }); // ???? if (m_useForView) { m_viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { StructuredSelection selection = (StructuredSelection) event.getSelection(); JobTreeItem item = (JobTreeItem) selection.getFirstElement(); int type = item.getData().getType(); m_log.info("double click. type=" + type); if (type != JobConstant.TYPE_REFERJOB && type != JobConstant.TYPE_REFERJOBNET && type != JobConstant.TYPE_APPROVALJOB && type != JobConstant.TYPE_FILEJOB && type != JobConstant.TYPE_MONITORJOB && type != JobConstant.TYPE_JOB && type != JobConstant.TYPE_JOBUNIT && type != JobConstant.TYPE_JOBNET) { return; } String managerName = null; JobTreeItem mgrTree = JobTreeItemUtil.getManager(item); if (mgrTree == null) { managerName = item.getChildren().get(0).getData().getId(); } else { managerName = mgrTree.getData().getId(); } JobEditState jobEditState = JobEditStateUtil.getJobEditState(managerName); boolean readOnly = !jobEditState.isLockedJobunitId(item.getData().getJobunitId()); JobDialog dialog = new JobDialog(JobTreeComposite.this, JobTreeComposite.this.getShell(), managerName, readOnly); dialog.setJobTreeItem(item); // if (dialog.open() == IDialogConstants.OK_ID) { if (jobEditState.isLockedJobunitId(item.getData().getJobunitId())) { // ?????(??????? jobEditState.addEditedJobunit(item); if (item.getData().getType() == JobConstant.TYPE_JOBUNIT) { JobUtil.setJobunitIdAll(item, item.getData().getJobunitId()); } } m_viewer.sort(item.getParent()); m_viewer.refresh(item.getParent()); m_viewer.refresh(item); m_viewer.setSelection(new StructuredSelection(item), true); } } }); } updateTree(m_useForView); }
From source file:com.clustercontrol.jobmanagement.composite.MonitorComposite.java
License:Open Source License
/** * ?????/*from w w w . j a va 2 s .co m*/ */ private void initialize() { Label label = null; this.setLayout(JobDialogUtil.getParentLayout()); // Group cmdScopeGroup = new Group(this, SWT.NONE); cmdScopeGroup.setText(Messages.getString("scope")); cmdScopeGroup.setLayout(new GridLayout(3, false)); // this.m_scopeJobParam = new Button(cmdScopeGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_scopeJobParam", this.m_scopeJobParam); this.m_scopeJobParam.setText(Messages.getString("job.parameter") + " : "); this.m_scopeJobParam.setLayoutData(new GridData(120, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_scopeJobParam.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { m_scopeFixedValue.setSelection(false); m_scopeSelect.setEnabled(false); } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // label = new Label(cmdScopeGroup, SWT.LEFT); label.setText(SystemParameterConstant.getParamText(SystemParameterConstant.FACILITY_ID)); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); //dummy new Label(cmdScopeGroup, SWT.LEFT); // this.m_scopeFixedValue = new Button(cmdScopeGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_scopeFixedValue", this.m_scopeFixedValue); this.m_scopeFixedValue.setText(Messages.getString("fixed.value") + " : "); this.m_scopeFixedValue.setLayoutData(new GridData(120, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_scopeFixedValue.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { m_scopeJobParam.setSelection(false); m_scopeSelect.setEnabled(true); } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // this.m_scope = new Text(cmdScopeGroup, SWT.BORDER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_scope", this.m_scope); this.m_scope.setLayoutData(new GridData(200, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_scope.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ? this.m_scopeSelect = new Button(cmdScopeGroup, SWT.NONE); WidgetTestUtil.setTestId(this, "m_scopeSelect", this.m_scopeSelect); this.m_scopeSelect.setText(Messages.getString("refer")); this.m_scopeSelect.setLayoutData(new GridData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_scopeSelect.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ScopeTreeDialog dialog = new ScopeTreeDialog(m_shell, m_managerName, m_ownerRoleId); if (dialog.open() == IDialogConstants.OK_ID) { FacilityTreeItem selectItem = dialog.getSelectItem(); FacilityInfo info = selectItem.getData(); FacilityPath path = new FacilityPath(ClusterControlPlugin.getDefault().getSeparator()); m_facilityPath = path.getPath(selectItem); m_facilityId = info.getFacilityId(); m_scope.setText(m_facilityPath); update(); } } }); // ? Group cmdScopeProcGroup = new Group(this, SWT.NONE); cmdScopeProcGroup.setText(Messages.getString("scope.process")); cmdScopeProcGroup.setLayout(new RowLayout()); // ??? this.m_allNode = new Button(cmdScopeProcGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_allNode", this.m_allNode); this.m_allNode.setText(Messages.getString("scope.process.all.nodes")); this.m_allNode.setLayoutData(new RowData(150, SizeConstant.SIZE_BUTTON_HEIGHT)); // ???? this.m_retry = new Button(cmdScopeProcGroup, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_retry", this.m_retry); this.m_retry.setText(Messages.getString("scope.process.retry.nodes")); this.m_retry.setLayoutData(new RowData(350, SizeConstant.SIZE_BUTTON_HEIGHT)); // Composite Composite monitorComposite = new Composite(this, SWT.NONE); monitorComposite.setLayout(new RowLayout()); // label = new Label(monitorComposite, SWT.NONE); label.setText(Messages.getString("monitor.setting") + " : "); label.setLayoutData(new RowData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_monitorIdCombo = new Combo(monitorComposite, SWT.DROP_DOWN | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_monitorIdCombo", this.m_monitorIdCombo); this.m_monitorIdCombo.setLayoutData(new RowData(350, SizeConstant.SIZE_COMBO_HEIGHT)); this.m_monitorIdCombo.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Combo check = (Combo) e.getSource(); WidgetTestUtil.setTestId(this, null, check); String monitorTypeId = getMonitorTypeId(check.getText()); if (monitorTypeId != null && (monitorTypeId.equals(HinemosModuleConstant.MONITOR_SNMPTRAP) || monitorTypeId.equals(HinemosModuleConstant.MONITOR_SYSTEMLOG) || monitorTypeId.equals(HinemosModuleConstant.MONITOR_LOGFILE) || monitorTypeId.equals(HinemosModuleConstant.MONITOR_WINEVENT) || monitorTypeId.equals(HinemosModuleConstant.MONITOR_CUSTOMTRAP_N) || monitorTypeId.equals(HinemosModuleConstant.MONITOR_CUSTOMTRAP_S))) { m_waitTimeText.setEditable(true); m_waitEndValueText.setEditable(true); } else { m_waitTimeText.setEditable(false); m_waitEndValueText.setEditable(false); } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // ? this.m_monitorReferBtn = new Button(monitorComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_monitorReferBtn", this.m_monitorReferBtn); this.m_monitorReferBtn.setText(Messages.getString("refer")); this.m_monitorReferBtn.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_monitorReferBtn.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_monitorIdCombo.getText() == null || m_monitorIdCombo.getText().isEmpty()) { return; } MonitorModifyAction action = new MonitorModifyAction(); String monitorTypeId = getMonitorTypeId(m_monitorIdCombo.getText()); String monitorId = getMonitorId(m_monitorIdCombo.getText()); if (action.dialogOpen(m_shell, m_managerName, monitorTypeId, monitorId) == IDialogConstants.OK_ID) { update(); } } }); // Group endValueGroup = new Group(this, SWT.NONE); endValueGroup.setText(Messages.getString("end.value")); endValueGroup.setLayout(new GridLayout(5, false)); // label = new Label(endValueGroup, SWT.NONE); label.setText(Messages.getString("info") + " : "); label.setBackground(PriorityColorConstant.COLOR_INFO); label.setLayoutData(new GridData(70, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_infoEndValue = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_infoEndValue", this.m_infoEndValue); this.m_infoEndValue.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); ((GridData) this.m_infoEndValue.getLayoutData()).horizontalSpan = 2; this.m_infoEndValue.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_infoEndValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // label = new Label(endValueGroup, SWT.NONE); label.setText(Messages.getString("warning") + " : "); label.setBackground(PriorityColorConstant.COLOR_WARNING); label.setLayoutData(new GridData(70, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_warnEndValue = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_warnEndValue", this.m_warnEndValue); this.m_warnEndValue.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_warnEndValue.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_warnEndValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ? label = new Label(endValueGroup, SWT.NONE); label.setText(Messages.getString("critical") + " : "); label.setBackground(PriorityColorConstant.COLOR_CRITICAL); label.setLayoutData(new GridData(70, SizeConstant.SIZE_LABEL_HEIGHT)); // ? this.m_criticalEndValue = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_criticalEndValue", this.m_criticalEndValue); this.m_criticalEndValue.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); ((GridData) this.m_criticalEndValue.getLayoutData()).horizontalSpan = 2; this.m_criticalEndValue.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_criticalEndValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ? label = new Label(endValueGroup, SWT.NONE); label.setText(Messages.getString("unknown") + " : "); label.setBackground(PriorityColorConstant.COLOR_UNKNOWN); label.setLayoutData(new GridData(70, SizeConstant.SIZE_LABEL_HEIGHT)); // ? this.m_unknownEndValue = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_unknownEndValue", this.m_unknownEndValue); this.m_unknownEndValue.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_unknownEndValue.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_unknownEndValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); JobDialogUtil.getGridSeparator(endValueGroup, 5); // ????? label = new Label(endValueGroup, SWT.NONE); label.setText(Messages.getString("job.monitorjob.result.end")); label.setLayoutData(new GridData()); ((GridData) label.getLayoutData()).horizontalSpan = 5; // ????? label = new Label(endValueGroup, SWT.LEFT); label.setText(Messages.getString("time.out") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // ????? this.m_waitTimeText = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_waitTimeText", this.m_waitTimeText); this.m_waitTimeText.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_waitTimeText.addVerifyListener(new NumberVerifyListener(0, DataRangeConstant.SMALLINT_HIGH)); this.m_waitTimeText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ??????? label = new Label(endValueGroup, SWT.LEFT); label.setText(Messages.getString("min")); label.setLayoutData(new GridData(30, SizeConstant.SIZE_LABEL_HEIGHT)); // ????? label = new Label(endValueGroup, SWT.LEFT); label.setText(" " + Messages.getString("end.value") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // ????? this.m_waitEndValueText = new Text(endValueGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_waitEndValueText", this.m_waitEndValueText); this.m_waitEndValueText.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_waitEndValueText.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_waitEndValueText.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); }
From source file:com.clustercontrol.jobmanagement.composite.ParameterComposite.java
License:Open Source License
/** * ????//from w w w.j av a 2 s. c o m */ private void initialize() { this.setLayout(JobDialogUtil.getParentLayout()); // Label tableTitle = new Label(this, SWT.NONE); tableTitle.setText(Messages.getString("list")); // Table table = new Table(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); WidgetTestUtil.setTestId(this, "table", table); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(new RowData(430, 235)); // Composite Composite buttonComposite = new Composite(this, SWT.NONE); buttonComposite.setLayout(new RowLayout()); // dummy new Label(buttonComposite, SWT.NONE).setLayoutData(new RowData(190, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_createCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_createCondition", this.m_createCondition); this.m_createCondition.setText(Messages.getString("add")); this.m_createCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_createCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ParameterDialog dialog = new ParameterDialog(m_shell); if (dialog.open() == IDialogConstants.OK_ID) { ArrayList<?> info = dialog.getInputData(); @SuppressWarnings("unchecked") ArrayList<Object> list = (ArrayList<Object>) m_viewer.getInput(); if (list == null) { list = new ArrayList<Object>(); } else { // Check if parameter name already exists for (Object one : list) { @SuppressWarnings("unchecked") String name = (String) ((ArrayList<Object>) one).get(0); if (name.equals(info.get(0))) { MessageDialog.openError(null, Messages.getString("message.hinemos.1"), Messages.getString("message.hinemos.10", new Object[] { Messages.getString("job.parameter"), name })); return; } } } // Finally, add it list.add(info); m_viewer.setInput(list); } } }); // this.m_modifyCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_modifyCondition", this.m_modifyCondition); this.m_modifyCondition.setText(Messages.getString("modify")); this.m_modifyCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_modifyCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_selectItem != null) { ParameterDialog dialog = new ParameterDialog(m_shell); @SuppressWarnings("unchecked") ArrayList<Object> objList = m_selectItem.isEmpty() ? null : (ArrayList<Object>) m_selectItem.get(0); if (objList != null) { dialog.setInputData(objList); if (dialog.open() == IDialogConstants.OK_ID) { ArrayList<?> info = dialog.getInputData(); @SuppressWarnings("unchecked") ArrayList<Object> list = (ArrayList<Object>) m_viewer.getInput(); list.remove(objList); list.add(info); m_selectItem = null; m_viewer.setInput(list); } } } } }); // this.m_deleteCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_deleteCondition", this.m_deleteCondition); this.m_deleteCondition.setText(Messages.getString("delete")); this.m_deleteCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_deleteCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_selectItem != null) { ArrayList<?> list = (ArrayList<?>) m_viewer.getInput(); for (Object obj : m_selectItem) { if (obj instanceof ArrayList) { @SuppressWarnings("unchecked") ArrayList<Object> objList = (ArrayList<Object>) obj; list.remove(objList); m_selectItem = new ArrayList<Object>(); m_viewer.setInput(list); } } } } }); this.m_viewer = new CommonTableViewer(table); this.m_viewer.createTableColumn(GetParameterTableDefine.get(), GetParameterTableDefine.SORT_COLUMN_INDEX, GetParameterTableDefine.SORT_ORDER); this.m_viewer.addSelectionChangedListener(new ParameterSelectionChangedListener(this)); }
From source file:com.clustercontrol.jobmanagement.composite.ReferComposite.java
License:Open Source License
/** * ?????// w w w . j av a2 s .c o m */ private void initialize() { this.setLayout(JobDialogUtil.getParentLayout()); // Composite Composite referComposite = new Composite(this, SWT.NONE); referComposite.setLayout(new GridLayout(3, false)); //????? this.m_selectFromJobTreeRadio = new Button(referComposite, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_selectFromJobTreeRadio", this.m_selectFromJobTreeRadio); this.m_selectFromJobTreeRadio.setText(Messages.getString("job.select.jobtree")); GridData gridDataRadio = new GridData(); gridDataRadio.horizontalSpan = 3; gridDataRadio.horizontalAlignment = GridData.FILL; gridDataRadio.grabExcessHorizontalSpace = true; this.m_selectFromJobTreeRadio.setLayoutData(gridDataRadio); // ? this.m_selectFromJobTreeRadio.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { update(); } }); // ID Label jobunitLabel = new Label(referComposite, SWT.NONE); jobunitLabel.setText(Messages.getString("jobunit.id")); // ID Label jobLabel = new Label(referComposite, SWT.NONE); jobLabel.setText(Messages.getString("job.id")); // dummy new Label(referComposite, SWT.NONE); // ID this.m_textJobunitId = new Text(referComposite, SWT.BORDER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_textJobunitId", this.m_textJobunitId); this.m_textJobunitId.setLayoutData(new GridData(150, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_textJobunitId.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // ID this.m_textJobId = new Text(referComposite, SWT.BORDER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_textJobId", this.m_textJobId); this.m_textJobId.setLayoutData(new GridData(150, SizeConstant.SIZE_TEXT_HEIGHT)); // ?? this.m_buttonRefer = new Button(referComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_buttonRefer", this.m_buttonRefer); this.m_buttonRefer.setLayoutData(new GridData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_buttonRefer.setText(Messages.getString("refer")); this.m_buttonRefer.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { // JobTreeDialog dialog = new JobTreeDialog(m_shell, m_ownerRoleId, m_jobTreeItem, JobConstant.TYPE_REFERJOB); if (dialog.open() == IDialogConstants.OK_ID) { JobTreeItem selectItem = dialog.getSelectItem().isEmpty() ? null : dialog.getSelectItem().get(0); if (selectItem != null && selectItem.getData().getType() != JobConstant.TYPE_COMPOSITE) { m_textJobId.setText(selectItem.getData().getId()); m_textJobunitId.setText(selectItem.getData().getJobunitId()); if (selectItem.getData().getType() == JobConstant.TYPE_JOBNET) { m_referJobType = JobConstant.TYPE_REFERJOBNET; } else { m_referJobType = JobConstant.TYPE_REFERJOB; } } else { m_textJobId.setText(""); m_textJobunitId.setText(""); } } } }); // dummy new Label(referComposite, SWT.NONE); //?????? this.m_selectFromRegisteredModuleRadio = new Button(referComposite, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_selectFromRegisteredModuleRadio", this.m_selectFromRegisteredModuleRadio); this.m_selectFromRegisteredModuleRadio.setText(Messages.getString("job.select.module")); gridDataRadio = new GridData(); gridDataRadio.horizontalSpan = 3; gridDataRadio.horizontalAlignment = GridData.FILL; gridDataRadio.grabExcessHorizontalSpace = true; this.m_selectFromRegisteredModuleRadio.setLayoutData(gridDataRadio); // ? this.m_selectFromRegisteredModuleRadio.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { update(); } }); //???? this.m_ComboRegisteredModuleCombo = new Combo(referComposite, SWT.RIGHT | SWT.BORDER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_ComboRegisteredModuleCombo", m_ComboRegisteredModuleCombo); GridData gridData = new GridData(); gridData.horizontalSpan = 3; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; gridData.widthHint = 385; this.m_ComboRegisteredModuleCombo.setLayoutData(gridData); //??????reflectReferInfo()? this.m_ComboRegisteredModuleCombo.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent e) { update(); if (m_ComboRegisteredModuleCombo.getText() != null && !"".equals(m_ComboRegisteredModuleCombo.getText().trim())) { JobInfo info = registeredJobList.get(m_ComboRegisteredModuleCombo.getSelectionIndex()); if (info.getType() == JobConstant.TYPE_JOBNET) { m_referJobType = JobConstant.TYPE_REFERJOBNET; } else { m_referJobType = JobConstant.TYPE_REFERJOB; } } } }); reflectReferInfo(); }
From source file:com.clustercontrol.jobmanagement.composite.WaitRuleComposite.java
License:Open Source License
/** * ????// www . j ava 2s . c om * * @param jobType */ private void initialize(int jobType) { this.setLayout(JobDialogUtil.getParentLayout()); // Label tableTitle = new Label(this, SWT.NONE); tableTitle.setText(Messages.getString("object.list")); // int addTableWidth = 0; if (jobType == JobConstant.TYPE_JOBNET) { // ? addTableWidth = 0; } else if (jobType == JobConstant.TYPE_JOB) { // addTableWidth = 170; } else if (jobType == JobConstant.TYPE_FILEJOB) { // addTableWidth = 170; } else if (jobType == JobConstant.TYPE_REFERJOB || jobType == JobConstant.TYPE_REFERJOBNET) { // ??????? addTableWidth = 0; } else if (jobType == JobConstant.TYPE_APPROVALJOB) { // ? addTableWidth = 170; } else if (jobType == JobConstant.TYPE_MONITORJOB) { // addTableWidth = 170; } Table table = new Table(this, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.SINGLE); WidgetTestUtil.setTestId(this, "table", table); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(new RowData(430 + addTableWidth, 100)); // Composite Composite buttonComposite = new Composite(this, SWT.NONE); buttonComposite.setLayout(new RowLayout()); // dummy new Label(buttonComposite, SWT.NONE) .setLayoutData(new RowData(200 + addTableWidth, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_createCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_createCondition", this.m_createCondition); this.m_createCondition.setText(Messages.getString("add")); this.m_createCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_createCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { m_log.debug("widgetSelected"); WaitRuleDialog dialog = new WaitRuleDialog(m_shell, m_jobTreeItem); if (dialog.open() == IDialogConstants.OK_ID) { // ???????? boolean addWaitRule = true; @SuppressWarnings("unchecked") ArrayList<Integer> info = (ArrayList<Integer>) dialog.getInputData(); @SuppressWarnings("unchecked") ArrayList<ArrayList<Integer>> list = (ArrayList<ArrayList<Integer>>) m_viewer.getInput(); if (list == null) { list = new ArrayList<ArrayList<Integer>>(); } else { //?????????????false?? int newWaitRuleType = (Integer) info.get(GetWaitRuleTableDefine.JUDGMENT_OBJECT); if (newWaitRuleType == JudgmentObjectConstant.TYPE_TIME) { for (ArrayList<Integer> waitRule : list) { m_log.debug("WaitRuleComposite_initialize_info = " + info); int rule = waitRule.get(GetWaitRuleTableDefine.JUDGMENT_OBJECT); m_log.debug("WaitRuleComposite_initialize_rule = " + rule); if (rule == JudgmentObjectConstant.TYPE_TIME) { addWaitRule = false; MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.61")); } } } else if (newWaitRuleType == JudgmentObjectConstant.TYPE_START_MINUTE) { for (ArrayList<Integer> waitRule : list) { m_log.debug("WaitRuleComposite_initialize_info = " + info); int rule = waitRule.get(GetWaitRuleTableDefine.JUDGMENT_OBJECT); m_log.debug("WaitRuleComposite_initialize_rule = " + rule); if (rule == JudgmentObjectConstant.TYPE_START_MINUTE) { addWaitRule = false; MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.62")); } } } } if (addWaitRule) list.add(info); m_viewer.setInput(list); } } }); // this.m_modifyCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_modifyCondition", this.m_modifyCondition); this.m_modifyCondition.setText(Messages.getString("modify")); this.m_modifyCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_modifyCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { WaitRuleDialog dialog = new WaitRuleDialog(m_shell, m_jobTreeItem); if (m_selectItem != null) { dialog.setInputData(m_selectItem); if (dialog.open() == IDialogConstants.OK_ID) { ArrayList<?> info = dialog.getInputData(); @SuppressWarnings("unchecked") ArrayList<ArrayList<?>> list = (ArrayList<ArrayList<?>>) m_viewer.getInput(); list.remove(m_selectItem); list.add(info); m_selectItem = null; m_viewer.setInput(list); } } else { } } }); // this.m_deleteCondition = new Button(buttonComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_deleteCondition", this.m_deleteCondition); this.m_deleteCondition.setText(Messages.getString("delete")); this.m_deleteCondition.setLayoutData(new RowData(80, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_deleteCondition.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { ArrayList<?> list = (ArrayList<?>) m_viewer.getInput(); list.remove(m_selectItem); m_selectItem = null; m_viewer.setInput(list); } }); // separator JobDialogUtil.getSeparator(this); // ?? Group group = new Group(this, SWT.NONE); group.setText(Messages.getString("condition.between.objects")); group.setLayout(new RowLayout()); // ??AND this.m_andCondition = new Button(group, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_andCondition", this.m_andCondition); this.m_andCondition.setText(Messages.getString("and")); this.m_andCondition.setLayoutData(new RowData(100, SizeConstant.SIZE_BUTTON_HEIGHT)); // ??OR this.m_orCondition = new Button(group, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_orCondition", this.m_orCondition); this.m_orCondition.setText(Messages.getString("or")); this.m_orCondition.setLayoutData(new RowData(100, SizeConstant.SIZE_BUTTON_HEIGHT)); // separator JobDialogUtil.getSeparator(this); // ??????? this.m_endCondition = new Button(this, SWT.CHECK); WidgetTestUtil.setTestId(this, "m_endCondition", this.m_endCondition); this.m_endCondition.setText(Messages.getString("end.if.condition.unmatched")); this.m_endCondition.setLayoutData(new RowData(220, SizeConstant.SIZE_BUTTON_HEIGHT + 5)); this.m_endCondition.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Button check = (Button) e.getSource(); WidgetTestUtil.setTestId(this, null, check); if (check.getSelection()) { m_endStatus.setEnabled(true); m_endValue.setEditable(true); } else { m_endStatus.setEnabled(false); m_endValue.setEditable(false); } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // ??????Composite Composite endConditionGroup = new Composite(this, SWT.BORDER); endConditionGroup.setLayout(new GridLayout(2, false)); // ?????? Label endStatusTitle = new Label(endConditionGroup, SWT.LEFT); endStatusTitle.setText(Messages.getString("end.status") + " : "); endStatusTitle.setLayoutData(new GridData(80, SizeConstant.SIZE_LABEL_HEIGHT)); // ?????? this.m_endStatus = new Combo(endConditionGroup, SWT.CENTER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_endStatus", this.m_endStatus); this.m_endStatus.setLayoutData(new GridData(100, SizeConstant.SIZE_COMBO_HEIGHT)); this.m_endStatus.add(EndStatusMessage.STRING_NORMAL); this.m_endStatus.add(EndStatusMessage.STRING_WARNING); this.m_endStatus.add(EndStatusMessage.STRING_ABNORMAL); // ?????? Label endValueTitle = new Label(endConditionGroup, SWT.LEFT); endValueTitle.setText(Messages.getString("end.value") + " : "); endValueTitle.setLayoutData(new GridData(80, SizeConstant.SIZE_LABEL_HEIGHT)); // ?????? this.m_endValue = new Text(endConditionGroup, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_endValue", this.m_endValue); this.m_endValue.setLayoutData(new GridData(100, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_endValue.addVerifyListener( new NumberVerifyListener(DataRangeConstant.SMALLINT_LOW, DataRangeConstant.SMALLINT_HIGH)); this.m_endValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); this.m_viewer = new CommonTableViewer(table); this.m_viewer.createTableColumn(GetWaitRuleTableDefine.get(), GetWaitRuleTableDefine.SORT_COLUMN_INDEX, GetWaitRuleTableDefine.SORT_ORDER); this.m_viewer.addSelectionChangedListener(new WaitRuleSelectionChangedListener(this)); }
From source file:com.clustercontrol.jobmanagement.dialog.JobKickDialog.java
License:Open Source License
/** * ????/*from w w w . j a v a 2s .c o m*/ * * @param parent ? */ @Override protected void customizeDialog(Composite parent) { this.m_shell = this.getShell(); Label label = null; String title = ""; if (this.m_jobkickType == JobKickConstant.TYPE_SCHEDULE) { title = Messages.getString("dialog.job.add.modify.schedule"); } else if (this.m_jobkickType == JobKickConstant.TYPE_FILECHECK) { title = Messages.getString("dialog.job.add.modify.filecheck"); } else if (this.m_jobkickType == JobKickConstant.TYPE_MANUAL) { title = Messages.getString("dialog.job.add.modify.manual"); } parent.getShell().setText(title); /** * * ????? */ RowLayout layout = new RowLayout(); layout.type = SWT.VERTICAL; layout.spacing = 0; layout.marginWidth = 10; layout.marginHeight = 10; layout.marginBottom = 0; layout.fill = true; parent.setLayout(layout); // Composite Composite jobKickComposite = new Composite(parent, SWT.NONE); jobKickComposite.setLayout(new GridLayout(3, false)); // ? label = new Label(jobKickComposite, SWT.LEFT); label.setText(Messages.getString("facility.manager") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ? if (this.m_mode == PropertyDefineConstant.MODE_MODIFY) { this.m_managerComposite = new ManagerListComposite(jobKickComposite, SWT.NONE, false); } else { this.m_managerComposite = new ManagerListComposite(jobKickComposite, SWT.NONE, true); } WidgetTestUtil.setTestId(this, "m_managerComposite", this.m_managerComposite); this.m_managerComposite.setLayoutData(new GridData()); ((GridData) this.m_managerComposite.getLayoutData()).widthHint = 227; if (this.m_managerName != null) { this.m_managerComposite.setText(this.m_managerName); } if (this.m_mode != PropertyDefineConstant.MODE_MODIFY) { this.m_managerComposite.getComboManagerName().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { String managerName = m_managerComposite.getText(); m_cmpOwnerRoleId.createRoleIdList(managerName); if (m_jobkickType != JobKickConstant.TYPE_MANUAL) { updateCalendarId(); if (m_jobkickType == JobKickConstant.TYPE_FILECHECK) { ((JobKickFileCheckComposite) m_detailComposite) .setOwnerRoleId(m_managerComposite.getText(), m_cmpOwnerRoleId.getText()); } } } }); } // dummy new Label(jobKickComposite, SWT.NONE); // ID label = new Label(jobKickComposite, SWT.NONE); label.setText(Messages.getString("jobkick.id") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ID this.m_txtJobKickId = new Text(jobKickComposite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtJobKickId", this.m_txtJobKickId); this.m_txtJobKickId.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtJobKickId.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_64)); this.m_txtJobKickId.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(jobKickComposite, SWT.NONE); // ?? label = new Label(jobKickComposite, SWT.NONE); label.setText(Messages.getString("jobkick.name") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ?? this.m_txtJobKickName = new Text(jobKickComposite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtJobKickName", this.m_txtJobKickName); this.m_txtJobKickName.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtJobKickName.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_64)); this.m_txtJobKickName.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(jobKickComposite, SWT.NONE); // label = new Label(jobKickComposite, SWT.NONE); label.setText(Messages.getString("owner.role.id") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ID if (this.m_mode == PropertyDefineConstant.MODE_ADD || this.m_mode == PropertyDefineConstant.MODE_COPY) { this.m_cmpOwnerRoleId = new RoleIdListComposite(jobKickComposite, SWT.NONE, this.m_managerName, true, Mode.OWNER_ROLE); this.m_cmpOwnerRoleId.getComboRoleId().addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_jobkickType != JobKickConstant.TYPE_MANUAL) { m_cmpCalendarId.createCalIdCombo(m_managerName, m_cmpOwnerRoleId.getText()); m_txtJobId.setText(""); m_txtJobName.setText(""); setJobunitId(null); // ????? if (m_jobkickType == JobKickConstant.TYPE_FILECHECK) { ((JobKickFileCheckComposite) m_detailComposite) .setOwnerRoleId(m_managerComposite.getText(), m_cmpOwnerRoleId.getText()); } } } }); } else { this.m_cmpOwnerRoleId = new RoleIdListComposite(jobKickComposite, SWT.NONE, this.m_managerName, false, Mode.OWNER_ROLE); } WidgetTestUtil.setTestId(this, "m_cmpOwnerRoleId", this.m_cmpOwnerRoleId); this.m_cmpOwnerRoleId.setLayoutData(new GridData()); ((GridData) this.m_cmpOwnerRoleId.getLayoutData()).widthHint = 227; // dummy new Label(jobKickComposite, SWT.NONE); // ID label = new Label(jobKickComposite, SWT.LEFT); label.setText(Messages.getString("job.id") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ID this.m_txtJobId = new Text(jobKickComposite, SWT.READ_ONLY | SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtJobId", this.m_txtJobId); this.m_txtJobId.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtJobId.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // this.m_btnJobSelect = new Button(jobKickComposite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnJobSelect", this.m_btnJobSelect); this.m_btnJobSelect.setText(Messages.getString("refer")); this.m_btnJobSelect.setLayoutData(new GridData(40, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnJobSelect.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { JobTreeDialog dialog = new JobTreeDialog(m_shell, m_managerComposite.getText(), m_cmpOwnerRoleId.getText(), true); if (dialog.open() == IDialogConstants.OK_ID) { JobTreeItem selectItem = dialog.getSelectItem().isEmpty() ? null : dialog.getSelectItem().get(0); if (selectItem != null && selectItem.getData().getType() != JobConstant.TYPE_COMPOSITE) { m_txtJobId.setText(selectItem.getData().getId()); m_txtJobName.setText(selectItem.getData().getName()); setJobunitId(selectItem.getData().getJobunitId()); } else { m_txtJobId.setText(""); m_txtJobName.setText(""); setJobunitId(null); } } } }); // ?? label = new Label(jobKickComposite, SWT.LEFT); label.setText(Messages.getString("job.name") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ?? this.m_txtJobName = new Text(jobKickComposite, SWT.BORDER | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "txtJobName", this.m_txtJobName); this.m_txtJobName.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); // dummy new Label(jobKickComposite, SWT.NONE); if (m_jobkickType != JobKickConstant.TYPE_MANUAL) { // ID label = new Label(jobKickComposite, SWT.LEFT); label.setText(Messages.getString("calendar.id") + " : "); label.setLayoutData(new GridData(140, SizeConstant.SIZE_LABEL_HEIGHT)); // ID this.m_cmpCalendarId = new CalendarIdListComposite(jobKickComposite, SWT.NONE, false); WidgetTestUtil.setTestId(this, "cmpCalendarId", this.m_cmpCalendarId); this.m_cmpCalendarId.setLayoutData(new GridData()); ((GridData) this.m_cmpCalendarId.getLayoutData()).widthHint = 227; // dummy new Label(jobKickComposite, SWT.NONE); } // separator JobDialogUtil.getSeparator(parent); // this.m_tabFolder = new TabFolder(parent, SWT.NONE); if (this.m_jobkickType == JobKickConstant.TYPE_SCHEDULE) { // this.m_detailComposite = new JobKickScheduleComposite(this.m_tabFolder, SWT.NONE); TabItem scheduleTabItem = new TabItem(this.m_tabFolder, SWT.NONE); WidgetTestUtil.setTestId(this, "scheduleTabItem", scheduleTabItem); scheduleTabItem.setText(Messages.getString("schedule.setting")); scheduleTabItem.setControl(this.m_detailComposite); } else if (this.m_jobkickType == JobKickConstant.TYPE_FILECHECK) { // ? this.m_detailComposite = new JobKickFileCheckComposite(this.m_tabFolder, SWT.NONE); TabItem fileTabItem = new TabItem(this.m_tabFolder, SWT.NONE); WidgetTestUtil.setTestId(this, "fileTabItem", fileTabItem); fileTabItem.setText(Messages.getString("file.check.setting")); fileTabItem.setControl(this.m_detailComposite); } else if (this.m_jobkickType == JobKickConstant.TYPE_MANUAL) { // } else { // ?? } // this.m_jobKickParamComposite = new JobKickParamComposite(this.m_tabFolder, SWT.NONE); TabItem paramTabItem = new TabItem(this.m_tabFolder, SWT.NONE); WidgetTestUtil.setTestId(this, "paramTabItem", paramTabItem); paramTabItem.setText(Messages.getString("job.parameter")); paramTabItem.setControl(this.m_jobKickParamComposite); if (this.m_jobkickType != JobKickConstant.TYPE_MANUAL) { // separator JobDialogUtil.getSeparator(parent); Group groupValidOrInvalid = new Group(parent, SWT.NONE); groupValidOrInvalid.setLayout(new RowLayout()); groupValidOrInvalid.setText(Messages.getString("valid") + "/" + Messages.getString("invalid")); // this.m_btnValid = new Button(groupValidOrInvalid, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnValid", this.m_btnValid); this.m_btnValid.setText(ValidMessage.STRING_VALID); this.m_btnValid.setLayoutData(new RowData(200, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnValid.setSelection(true); // this.m_btnInvalid = new Button(groupValidOrInvalid, SWT.RADIO); WidgetTestUtil.setTestId(this, "m_btnInvalid", this.m_btnInvalid); this.m_btnInvalid.setText(ValidMessage.STRING_INVALID); this.m_btnInvalid.setLayoutData(new RowData(200, SizeConstant.SIZE_BUTTON_HEIGHT)); } // this.adjustDialog(); //?? if (this.m_jobkickType == JobKickConstant.TYPE_SCHEDULE) { reflectJobSchedule(); } else if (this.m_jobkickType == JobKickConstant.TYPE_FILECHECK) { reflectJobFileCheck(); } else if (this.m_jobkickType == JobKickConstant.TYPE_MANUAL) { reflectJobManual(); } // ? update(); }
From source file:com.clustercontrol.jobmanagement.dialog.RuntimeParameterDialog.java
License:Open Source License
/** * ????/*from w w w.j a v a 2 s . c o m*/ * * @param parent ? */ @Override protected void customizeDialog(Composite parent) { m_shell = this.getShell(); parent.getShell().setText(Messages.getString("dialog.job.add.modify.manual.param")); Label label = null; /** * * ????? */ RowLayout layout = new RowLayout(); layout.type = SWT.VERTICAL; layout.spacing = 0; layout.marginWidth = 10; layout.marginHeight = 10; layout.marginBottom = 0; layout.fill = true; parent.setLayout(layout); // Composite Composite composite = new Composite(parent, SWT.NONE); composite.setLayout(new GridLayout(3, false)); // ??? label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("name") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // ??? this.m_txtParamId = new Text(composite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtParamId", this.m_txtParamId); this.m_txtParamId.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtParamId.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_64)); this.m_txtParamId.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(composite, SWT.NONE); // label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("description") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_txtDescription = new Text(composite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtDescription", this.m_txtDescription); this.m_txtDescription.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtDescription.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_256)); this.m_txtDescription.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(composite, SWT.NONE); // label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("type") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_cmbType = new Combo(composite, SWT.DROP_DOWN | SWT.READ_ONLY); WidgetTestUtil.setTestId(this, "m_cmbType", this.m_cmbType); this.m_cmbType.setLayoutData(new GridData(200, SizeConstant.SIZE_COMBO_HEIGHT)); this.m_cmbType.add(Messages.getString("job.manual.type.input")); this.m_cmbType.add(Messages.getString("job.manual.type.radio")); this.m_cmbType.add(Messages.getString("job.manual.type.combo")); this.m_cmbType.add(Messages.getString("job.manual.type.fixed")); this.m_cmbType.select(0); this.m_cmbType.addSelectionListener(new SelectionListener() { @Override public void widgetSelected(SelectionEvent e) { Combo combo = (Combo) e.getSource(); WidgetTestUtil.setTestId(this, null, combo); Integer type = JobRuntimeParamTypeMessage.stringToType(combo.getText()); if (type == JobRuntimeParamTypeConstant.TYPE_INPUT) { m_txtDefaultValue.setEditable(true); } else if (type == JobRuntimeParamTypeConstant.TYPE_RADIO) { m_txtDefaultValue.setEditable(false); } else if (type == JobRuntimeParamTypeConstant.TYPE_COMBO) { m_txtDefaultValue.setEditable(false); } else if (type == JobRuntimeParamTypeConstant.TYPE_FIXED) { m_txtDefaultValue.setEditable(true); } update(); } @Override public void widgetDefaultSelected(SelectionEvent e) { } }); // dummy new Label(composite, SWT.NONE); // label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("default.value") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); // this.m_txtDefaultValue = new Text(composite, SWT.BORDER); WidgetTestUtil.setTestId(this, "m_txtDefaultValue", this.m_txtDefaultValue); this.m_txtDefaultValue.setLayoutData(new GridData(220, SizeConstant.SIZE_TEXT_HEIGHT)); this.m_txtDefaultValue.addVerifyListener(new StringVerifyListener(DataRangeConstant.VARCHAR_1024)); this.m_txtDefaultValue.addModifyListener(new ModifyListener() { @Override public void modifyText(ModifyEvent arg0) { update(); } }); // dummy new Label(composite, SWT.NONE); // ? label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("job.manual.select.item") + " : "); label.setLayoutData(new GridData(100, SizeConstant.SIZE_LABEL_HEIGHT)); ((GridData) label.getLayoutData()).verticalSpan = 6; ((GridData) label.getLayoutData()).verticalAlignment = SWT.BEGINNING; // ? Table table = new Table(composite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI); WidgetTestUtil.setTestId(this, "table", table); table.setHeaderVisible(true); table.setLinesVisible(true); table.setLayoutData(new GridData(210, 135)); ((GridData) table.getLayoutData()).verticalSpan = 6; // ? this.m_btnSelectAdd = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectAdd", this.m_btnSelectAdd); this.m_btnSelectAdd.setText(Messages.getString("add")); this.m_btnSelectAdd.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectAdd.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { RuntimeParameterSelectionDialog dialog = new RuntimeParameterSelectionDialog(m_shell, m_jobRuntimeParam.getJobRuntimeParamDetailList(), new JobRuntimeParamDetail()); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParam.getJobRuntimeParamDetailList().add(dialog.getInputData()); if (dialog.getDefaultValueSelection()) { m_jobRuntimeParam.setValue(dialog.getInputData().getParamValue()); } reflectParamDetailInfo(); } } }); // ? this.m_btnSelectModify = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectModify", this.m_btnSelectModify); this.m_btnSelectModify.setText(Messages.getString("modify")); this.m_btnSelectModify.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectModify.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; RuntimeParameterSelectionDialog dialog = new RuntimeParameterSelectionDialog(m_shell, m_jobRuntimeParam.getJobRuntimeParamDetailList(), m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo), (m_jobRuntimeParam.getValue() == null ? false : m_jobRuntimeParam.getValue().equals(m_jobRuntimeParam .getJobRuntimeParamDetailList().get(orderNo).getParamValue()))); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParam.getJobRuntimeParamDetailList().remove(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().add(orderNo, dialog.getInputData()); if (dialog.getDefaultValueSelection()) { m_jobRuntimeParam.setValue(dialog.getInputData().getParamValue()); } else { if (m_jobRuntimeParam.getValue() != null && m_jobRuntimeParam.getValue().equals(dialog.getInputData().getParamValue())) { m_jobRuntimeParam.setValue(null); } } reflectParamDetailInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // ? this.m_btnSelectDelete = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectDelete", this.m_btnSelectDelete); this.m_btnSelectDelete.setText(Messages.getString("delete")); this.m_btnSelectDelete.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectDelete.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; String detail = m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo).getDescription(); if (detail == null) { detail = ""; } String[] args = { detail }; if (MessageDialog.openConfirm(null, Messages.getString("confirmed"), Messages.getString("message.job.130", args))) { if (m_jobRuntimeParam.getValue() != null && m_jobRuntimeParam.getValue().equals( m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo).getParamValue())) { m_jobRuntimeParam.setValue(null); } m_jobRuntimeParam.getJobRuntimeParamDetailList().remove(orderNo); reflectParamDetailInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // ? this.m_btnSelectCopy = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectCopy", this.m_btnSelectCopy); this.m_btnSelectCopy.setText(Messages.getString("copy")); this.m_btnSelectCopy.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectCopy.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; // ? JobRuntimeParamDetail paramDetail = new JobRuntimeParamDetail(); paramDetail.setDescription( m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo).getDescription()); paramDetail.setParamValue( m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo).getParamValue()); RuntimeParameterSelectionDialog dialog = new RuntimeParameterSelectionDialog(m_shell, m_jobRuntimeParam.getJobRuntimeParamDetailList(), paramDetail); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParam.getJobRuntimeParamDetailList().add(dialog.getInputData()); if (dialog.getDefaultValueSelection()) { m_jobRuntimeParam.setValue(dialog.getInputData().getParamValue()); } reflectParamDetailInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // ?? this.m_btnSelectUp = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectUp", this.m_btnSelectUp); this.m_btnSelectUp.setText(Messages.getString("up")); this.m_btnSelectUp.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectUp.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; if (orderNo > 0) { JobRuntimeParamDetail jobRuntimeParamDetail = m_jobRuntimeParam .getJobRuntimeParamDetailList().get(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().remove(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().add(orderNo - 1, jobRuntimeParamDetail); reflectParamDetailInfo(); m_viewer.getTable().setSelection(orderNo - 1); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // ?? this.m_btnSelectDown = new Button(composite, SWT.NONE); WidgetTestUtil.setTestId(this, "m_btnSelectDown", this.m_btnSelectDown); this.m_btnSelectDown.setText(Messages.getString("down")); this.m_btnSelectDown.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); this.m_btnSelectDown.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; if (orderNo < m_jobRuntimeParam.getJobRuntimeParamDetailList().size() - 1) { JobRuntimeParamDetail jobRuntimeParamDetail = m_jobRuntimeParam .getJobRuntimeParamDetailList().get(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().remove(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().add(orderNo + 1, jobRuntimeParamDetail); reflectParamDetailInfo(); m_viewer.getTable().setSelection(orderNo + 1); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // label = new Label(composite, SWT.LEFT); label.setText(Messages.getString("job.manual.required") + " : "); label.setLayoutData(new GridData(60, SizeConstant.SIZE_LABEL_HEIGHT)); // ? this.m_chkRequiredFlg = new Button(composite, SWT.CHECK); WidgetTestUtil.setTestId(this, "m_chkRequiredFlg", this.m_chkRequiredFlg); this.m_btnSelectDown.setLayoutData(new GridData(50, SizeConstant.SIZE_BUTTON_HEIGHT)); // dummy new Label(composite, SWT.NONE); this.m_viewer = new CommonTableViewer(table); this.m_viewer.createTableColumn(GetRuntimeParameterTableDefine.get(), GetRuntimeParameterTableDefine.SORT_COLUMN_INDEX, GetRuntimeParameterTableDefine.SORT_ORDER); this.m_viewer.addDoubleClickListener(new IDoubleClickListener() { @Override public void doubleClick(DoubleClickEvent event) { if (m_viewer.getTable().getSelectionIndex() >= 0) { int orderNo = (Integer) ((ArrayList<?>) m_viewer.getTable().getSelection()[0].getData()).get(1) - 1; RuntimeParameterSelectionDialog dialog = new RuntimeParameterSelectionDialog(m_shell, m_jobRuntimeParam.getJobRuntimeParamDetailList(), m_jobRuntimeParam.getJobRuntimeParamDetailList().get(orderNo), (m_jobRuntimeParam.getValue() == null ? false : m_jobRuntimeParam.getValue().equals(m_jobRuntimeParam .getJobRuntimeParamDetailList().get(orderNo).getParamValue()))); if (dialog.open() == IDialogConstants.OK_ID) { m_jobRuntimeParam.getJobRuntimeParamDetailList().remove(orderNo); m_jobRuntimeParam.getJobRuntimeParamDetailList().add(orderNo, dialog.getInputData()); if (dialog.getDefaultValueSelection()) { m_jobRuntimeParam.setValue(dialog.getInputData().getParamValue()); } else { if (m_jobRuntimeParam.getValue().equals(dialog.getInputData().getParamValue())) { m_jobRuntimeParam.setValue(null); } } reflectParamDetailInfo(); } } else { MessageDialog.openWarning(null, Messages.getString("warning"), Messages.getString("message.job.129")); } } }); // ?? reflectParamInfo(); // ? update(); }