use of org.eclipse.swt.events.ModifyListener in project tesb-studio-se by Talend.
the class XmlTableForm method addFieldsListeners.
private void addFieldsListeners() {
nameFilter.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
String pattern = nameFilter.getText();
SearchPattern matcher = new SearchPattern();
matcher.setPattern(pattern);
final List<Item> newList = new ArrayList<Item>();
for (Item item : items) {
if (matcher.matches(item.getLabel())) {
newList.add(item);
}
}
reftesTableContent(newList);
completeListener.setComplete(!getSelectionItems().isEmpty());
}
});
// Event checkBox action
table.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
if (e.detail == SWT.CHECK) {
((Item) e.item.getData()).setCheck(((TableItem) e.item).getChecked());
if (null != completeListener) {
completeListener.setComplete(!getSelectionItems().isEmpty());
}
}
}
});
table.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
table.getColumns()[0].setWidth(table.getClientArea().width - 2 * table.getBorderWidth());
}
});
selectAllTablesButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
setChecked(true);
}
});
selectNoneTablesButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(final SelectionEvent e) {
setChecked(false);
}
});
}
use of org.eclipse.swt.events.ModifyListener in project tesb-studio-se by Talend.
the class OpenWSDLPage method createControl.
public void createControl(Composite parent) {
Composite parentArea = new Composite(parent, SWT.NONE);
parentArea.setLayout(new GridLayout());
radioCreateWsdl = new Button(parentArea, SWT.RADIO);
radioCreateWsdl.setText(Messages.AssignWsdlDialog_WsdlChoice_CreateNew);
radioCreateWsdl.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
switchRadio();
}
});
radioCreateWsdl.setSelection(true);
radioImportWsdl = new Button(parentArea, SWT.RADIO);
radioImportWsdl.setText(Messages.AssignWsdlDialog_WsdlChoice_ImportExistent);
radioImportWsdl.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
switchRadio();
}
});
Composite wsdlFileArea = new Composite(parentArea, SWT.NONE);
wsdlFileArea.setLayoutData(new GridData(SWT.FILL, SWT.NONE, true, false));
GridLayout layout = new GridLayout(3, false);
// layout.marginLeft = 15;
// layout.marginHeight = 0;
wsdlFileArea.setLayout(layout);
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
String[] xmlExtensions = { "*.xml;*.xsd;*.wsdl", "*.*", "*" };
wsdlText = new LabelledFileField(wsdlFileArea, Messages.AssignWsdlDialog_ExistentWsdlFilePath, xmlExtensions);
final String initialPath = //$NON-NLS-1$
null == item || null == item.getConnection() ? //$NON-NLS-1$
"" : ((ServiceConnection) item.getConnection()).getWSDLPath();
wsdlText.setText(initialPath);
wsdlText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
path = wsdlText.getText().trim();
setPageComplete(!path.isEmpty());
}
});
new Label(wsdlFileArea, SWT.NONE);
checkImport = new Button(wsdlFileArea, SWT.CHECK);
checkImport.setText(Messages.AssignWsdlDialog_ImportWsdlSchemas);
checkImport.setSelection(true);
switchRadio();
setControl(parentArea);
}
use of org.eclipse.swt.events.ModifyListener in project tesb-studio-se by Talend.
the class ServiceExportWSWizardPage method createControl.
public void createControl(Composite parent) {
setControl(parent);
Composite container = new Composite(parent, SWT.NONE);
container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
container.setLayout(new GridLayout(1, false));
Group destinationGroup = new Group(container, SWT.NONE);
destinationGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.GRAB_HORIZONTAL));
destinationGroup.setText("Destination");
destinationGroup.setLayout(new GridLayout(2, false));
destinationText = new Text(destinationGroup, SWT.SINGLE | SWT.BORDER);
destinationText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
destinationText.setText(getDestinationValue());
destinationText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
destinationValue = destinationText.getText();
checkDestination(destinationValue);
}
});
Button browseButton = new Button(destinationGroup, SWT.PUSH);
browseButton.setText("Browse");
browseButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
handleDestinationBrowseButtonPressed();
destinationText.setText(destinationValue);
}
});
Group optionsGroup = new Group(container, SWT.NONE);
GridData layoutData = new GridData(GridData.FILL_BOTH);
optionsGroup.setLayoutData(layoutData);
GridLayout layout = new GridLayout();
optionsGroup.setLayout(layout);
// optionsGroup.setText(IDEWorkbenchMessages.WizardExportPage_options);
//$NON-NLS-1$
optionsGroup.setText(org.talend.repository.i18n.Messages.getString("IDEWorkbenchMessages.WizardExportPage_options"));
optionsGroup.setFont(parent.getFont());
createBSGroup(optionsGroup);
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class MultiPageSqlBuilderEditor method attachListeners.
/**
* qzhang Comment method "attachListeners".
*/
private void attachListeners() {
sqlDesigner.getColorText().addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
public void modifyText(ModifyEvent e) {
if (!isFirst) {
updateEditorTitle(null);
} else {
isFirst = false;
}
}
});
sqlEdit.getColorText().addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
public void modifyText(ModifyEvent e) {
if (!isFirst2) {
updateEditorTitle(null);
} else {
isFirst2 = false;
}
}
});
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class SQLPropertyDialog method addListener.
/**
* Adds modify listener.
*/
/**
* DOC dev Comment method "addListener".
*/
/**
* DOC dev Comment method "addListener".
*/
private void addListener() {
nameText.addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
@Override
public void modifyText(ModifyEvent e) {
String result = validate(nameText.getText());
if (result == null) {
SQLPropertyDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(true);
//$NON-NLS-1$
SQLPropertyDialog.this.setMessage(//$NON-NLS-1$
Messages.getString("SQLEditor.Actions.InputMessage"), IMessageProvider.INFORMATION);
} else {
SQLPropertyDialog.this.setMessage(result, IMessageProvider.ERROR);
SQLPropertyDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(false);
}
}
/**
* Validates input text.
*
* @param text
* @return a string
*/
private String validate(String text) {
if (nameText.getText().length() == 0) {
//$NON-NLS-1$
return Messages.getString("SQLEditor.Actions.EmptyNameMessage");
} else if (names.contains(text)) {
//$NON-NLS-1$
return Messages.getString("SQLEditor.Actions.DuplicateNameMessage");
}
return null;
}
});
commentText.addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
@Override
public void modifyText(ModifyEvent e) {
if (commentText.getText().length() == 0) {
//$NON-NLS-1$
SQLPropertyDialog.this.setMessage(//$NON-NLS-1$
Messages.getString("SQLEditor.Actions.EmptyCommentMessage"), IMessageProvider.INFORMATION);
} else if (showQueryProperty) {
SQLPropertyDialog.this.setMessage(//$NON-NLS-1$
Messages.getString("SQLEditor.SQLPropertyDialog.ShowQueryProperty.message"), IMessageProvider.INFORMATION);
SQLPropertyDialog.this.getButton(IDialogConstants.OK_ID).setEnabled(true);
}
}
});
}
Aggregations