use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class ComponentSettingsView method createButtonListener.
/**
* DOC zwang Comment method "createButtons".
*/
private void createButtonListener() {
// TODO Auto-generated method stub
// tabFactory.getTabbedPropertyComposite().getComposite().setBackground(
// ImageProvider.getImage(EImage.COMPOSITE_BACKGROUND).getBackground());
Button compactButton = tabFactory.getTabbedPropertyComposite().getCompactButton();
if (compactButton != null && !compactButton.isDisposed()) {
compactButton.setVisible(true);
if (compactListener == null) {
compactListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getPreference().setValue(TalendDesignerPrefConstants.VIEW_OPTIONS, ComponentSettingsView.DEFAULT);
if (getDc() != null) {
getDc().dispose();
Composite composite = getParentMap().get(ComponentSettingsView.PARENT);
EComponentCategory category2 = getCategoryMap().get(ComponentSettingsView.CATEGORY);
if (composite != null && category2 != null) {
createDynamicComposite(composite, element, category2);
}
}
}
};
compactButton.addSelectionListener(compactListener);
}
}
Button tableButton = tabFactory.getTabbedPropertyComposite().getTableButton();
if (tableButton != null && !tableButton.isDisposed()) {
tableButton.setVisible(true);
if (tableButtonListener == null) {
tableButtonListener = new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
getPreference().setValue(TalendDesignerPrefConstants.VIEW_OPTIONS, ComponentSettingsView.TABLEVIEW);
if (getDc() != null) {
getDc().dispose();
Composite composite = getParentMap().get(ComponentSettingsView.PARENT);
EComponentCategory category2 = getCategoryMap().get(ComponentSettingsView.CATEGORY);
if (composite != null && category2 != null) {
createDynamicComposite(composite, element, category2);
}
}
}
};
tableButton.addSelectionListener(tableButtonListener);
}
}
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class MissingSettingsMultiThreadDynamicComposite method afterCreateMessagesComposite.
@Override
public void afterCreateMessagesComposite(MessagesComposite messComposite) {
final Element ele = this.getElement();
if (ele instanceof Node && isVisibleTopMessages()) {
final IComponent component = ((Node) ele).getComponent();
messComposite.updateTopMessages(//$NON-NLS-1$
Messages.getString(//$NON-NLS-1$
"MissingSettingsMultiThreadDynamicComposite_missingModulesMessages", component.getName()), IStatus.WARNING);
if (messComposite instanceof MessagesWithActionComposite) {
MessagesWithActionComposite messWithActionComposite = (MessagesWithActionComposite) messComposite;
messWithActionComposite.updateActionButton(//$NON-NLS-1$
Messages.getString("MissingSettingsMultiThreadDynamicComposite.installName") + "...", //$NON-NLS-1$
null);
messWithActionComposite.addActionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (!missModulesNeeded.isEmpty()) {
ModulesInstallerUtil.forceInstallModules(getShell(), component, missModulesNeeded);
checkVisibleTopMessages();
}
}
});
}
}
super.afterCreateMessagesComposite(messComposite);
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class SchemaDetailsCheckBoxCellEditor method createControl.
@Override
protected Control createControl(Composite parent) {
checkBtn = new Button(parent, SWT.CHECK);
checkBtn.addKeyListener(new KeyAdapter() {
public void keyReleased(KeyEvent e) {
if (e.character == '') {
// Escape
fireCancelEditor();
}
}
});
checkBtn.addFocusListener(getButtonFocusListener());
checkBtn.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
markDirty();
doSetValue(checkBtn.getSelection());
// fireApplyEditorValue();
}
});
setValueValid(true);
return checkBtn;
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class MemoryRuntimeComposite method addListeners.
private void addListeners() {
runtimeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent event) {
getRemoteStatus();
boolean isRunButtonPressed = runtimeButton.getText().equals(Messages.getString("ProcessComposite.exec"));
boolean isKillButtonPressed = runtimeButton.getText().equals(Messages.getString("ProcessComposite.kill"));
if (lock && isRunButtonPressed) {
// $NON-NLS-1$
//$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.anotherJobMonitoring"));
return;
}
if (isCommandlineRun) {
//$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.commandlineForbidden"));
return;
}
if (isRemoteRun && !isRemoteMonitoring) {
//$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.remoteMonitoringUnavailable"));
return;
}
if (processContext != null && !processContext.isRunning() && isRunButtonPressed) {
// $NON-NLS-1$
runtimeButton.setEnabled(false);
isReadyToStart = true;
exec();
}
if (processContext != null && (processContext.isRunning() || isReadyToStart)) {
if (isRunButtonPressed) {
if (!acquireJVM()) {
isReadyToStart = false;
runtimeButton.setEnabled(true);
//$NON-NLS-1$
MessageDialog.openWarning(//$NON-NLS-1$
getShell(), //$NON-NLS-1$
"Warning", //$NON-NLS-1$
Messages.getString("ProcessView.connectToMonitorServerFailed"));
return;
}
initMonitoringModel();
refreshMonitorComposite();
processContext.setMonitoring(true);
AbstractRuntimeGraphcsComposite.setMonitoring(true);
setRuntimeButtonByStatus(false);
isReadyToStart = false;
if (periodCombo.isEnabled() && periodCombo.getSelectionIndex() != 0) {
startCustomerGCSchedule();
}
//$NON-NLS-1$
String content = getExecutionInfo("Start");
messageManager.setStartMessage(content, getDisplay().getSystemColor(SWT.COLOR_BLUE), getDisplay().getSystemColor(SWT.COLOR_WHITE));
((RuntimeGraphcsComposite) chartComposite).displayReportField();
lock = true;
} else if (isKillButtonPressed) {
// $NON-NLS-1$
processContext.kill();
}
} else {
//$NON-NLS-1$ //$NON-NLS-2$
MessageDialog.openWarning(getShell(), "Warning", Messages.getString("ProcessView.noJobRunning"));
}
runtimeButton.setEnabled(true);
}
});
gcCheckButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
isGCSelected = gcCheckButton.getSelection();
periodCombo.setEnabled(isGCSelected);
if (!isGCSelected) {
periodCombo.select(0);
if (processContext != null && processContext.isRunning()) {
// cancel GC timer task during job running.
doScheduledGc(0);
}
}
}
});
periodCombo.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
startCustomerGCSchedule();
}
});
propertyChangeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
runProcessContextChanged(evt);
}
};
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class AdvanceSettingComposite method addListeners.
/**
* DOC Administrator Comment method "addListeners".
*/
private void addListeners() {
// TODO Auto-generated method stub
watchBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
processContext.setWatchAllowed(watchBtn.getSelection());
processManager.setExecTime(watchBtn.getSelection());
}
});
saveJobBeforeRunButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
processContext.setSaveBeforeRun(saveJobBeforeRunButton.getSelection());
processManager.setSaveJobBeforeRun(saveJobBeforeRunButton.getSelection());
}
});
perfBtn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
processContext.setMonitorPerf(perfBtn.getSelection());
processManager.setStat(perfBtn.getSelection());
}
});
clearBeforeExec.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
processContext.setClearBeforeExec(clearBeforeExec.getSelection());
processManager.setClearBeforeExec(clearBeforeExec.getSelection());
}
});
}
Aggregations