use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.
the class SchemaDetailsColumnMouseAdapter method createTextControl.
private Control createTextControl(final TreeItem item, final EPropertyName pName, final MultiMetadataColumn multiMetadataColumn) {
final Text newEditor = new Text(getTree(), SWT.NONE);
if (UIManager.isFirstForColumnModel(pName)) {
newEditor.setText(MultiSchemasUtil.validateValue(multiMetadataColumn.getLabel()));
} else {
switch(pName) {
case LENGTH:
newEditor.setText(MultiSchemasUtil.getAndCheckIntgerValue(multiMetadataColumn.getLength()));
break;
// break;
case PATTERN:
newEditor.setText(MultiSchemasUtil.validateValue(multiMetadataColumn.getPattern()));
break;
}
}
newEditor.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
Text text = (Text) getEditor();
final String value = text.getText();
if (UIManager.isFirstForColumnModel(pName)) {
if (//$NON-NLS-1$
value != null && !"".equals(value.trim()) && UIManager.checkSchemaDetailsValue(getSchemaDetailsViewer(), multiMetadataColumn, pName, value)) {
multiMetadataColumn.setLabel(value.trim());
text.setBackground(null);
} else {
text.setBackground(redColor);
return;
}
} else {
switch(pName) {
case LENGTH:
if (!"".equals(value)) {
//$NON-NLS-1$
if (UIManager.checkSchemaDetailsValue(getSchemaDetailsViewer(), multiMetadataColumn, pName, value)) {
multiMetadataColumn.setLength(Integer.parseInt((String) value));
text.setBackground(null);
} else {
// else, don't change it.
text.setBackground(redColor);
return;
}
} else {
multiMetadataColumn.setLength(null);
}
break;
// break;
case PATTERN:
multiMetadataColumn.setPattern(value);
break;
}
}
getSchemaDetailsViewer().update(item.getData(), null);
}
});
newEditor.selectAll();
return newEditor;
}
use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.
the class AddRowDialog method createControls.
private void createControls(Composite main) {
keyLbl = new Label(main, SWT.NONE);
//$NON-NLS-1$
keyLbl.setText("Schema:");
key = new Text(main, SWT.BORDER);
key.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
keyValue = key.getText();
validate(keyValue);
}
});
recoredLbl = new Label(main, SWT.NONE);
//$NON-NLS-1$
recoredLbl.setText("Record:");
record = new Text(main, SWT.BORDER);
record.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
recordValue = record.getText();
}
});
sepLbl = new Label(main, SWT.NONE);
//$NON-NLS-1$
sepLbl.setText("Seperator:");
sep = new Text(main, SWT.BORDER);
sep.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
sepValue = sep.getText();
}
});
}
use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.
the class GenerateDocAsHTMLWizardPage method addDocumentListener.
private void addDocumentListener() {
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
cssField.setEditable(button.getSelection());
if (button.getSelection()) {
cssFilePath = cssField.getText();
}
updatePageCompletion();
}
});
cssField.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
cssFilePath = cssField.getText();
updatePageCompletion();
}
});
}
use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.
the class ToolsPreferencePage method createUpdatePeriodTextField.
/**
* Creates the update period text field.
*
* @param parent
* The parent composite
*/
private void createUpdatePeriodTextField(Composite parent) {
Group group = new Group(parent, SWT.NONE);
group.setLayout(new GridLayout(2, false));
group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
group.setText(Messages.autoDetectGroupLabel);
Label label = new Label(group, SWT.NONE);
label.setText(Messages.updatePeriodLabel);
updatePeriodText = new Text(group, SWT.BORDER);
updatePeriodText.setText(String.valueOf(getPreferenceStore().getInt(IConstants.UPDATE_PERIOD)));
updatePeriodText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
updatePeriodText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validateUpdatePeriod();
}
});
}
use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.
the class ToolsPreferencePage method createJdkRootDirectoryGroup.
/**
* Creates the JDK root directory group.
*
* @param parent
* The parent composite
*/
private void createJdkRootDirectoryGroup(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
composite.setLayout(new GridLayout(3, false));
composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Label label = new Label(composite, SWT.NONE);
label.setText(Messages.jdkRootDirectoryLabel);
jdkRootDirectoryText = new Text(composite, SWT.BORDER);
jdkRootDirectoryText.setText(getPreferenceStore().getString(IConstants.JDK_ROOT_DIRECTORY));
jdkRootDirectoryText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
jdkRootDirectoryText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
validateJdkRootDirectory();
}
});
Button button = new Button(composite, SWT.NONE);
button.setText(Messages.browseButton);
button.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
DirectoryDialog dialog = new DirectoryDialog(e.display.getActiveShell());
dialog.setMessage(Messages.selectJdkRootDirectoryMsg);
String path = dialog.open();
if (path == null) {
return;
}
File file = new File(path);
if (file.isDirectory()) {
jdkRootDirectoryText.setText(path);
}
}
});
}
Aggregations