use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class FTPForm method addFieldsListeners.
/*
* (non-Javadoc)
*
* @see org.talend.repository.ui.swt.utils.AbstractForm#addFieldsListeners()
*/
@Override
protected void addFieldsListeners() {
ftpUsernameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setUsername(ftpUsernameText.getText());
checkFieldsValue();
}
});
ftpPasswordText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
FTPConnection conn = getConnection();
conn.setPassword(conn.getValue(ftpPasswordText.getText(), true));
checkFieldsValue();
}
});
ftpPortText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setPort(ftpPortText.getText());
checkFieldsValue();
}
});
ftpHostText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setHost(ftpHostText.getText());
checkFieldsValue();
}
});
proxyUsernameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setProxyuser(proxyUsernameText.getText());
}
});
proxyPasswordText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
FTPConnection conn = getConnection();
conn.setProxypassword(conn.getValue(proxyPasswordText.getText(), true));
}
});
proxyPortText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setProxyport(proxyPortText.getText());
}
});
proxyHostText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setProxyhost(proxyHostText.getText());
}
});
keyFileText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setKeystoreFile(PathUtils.getPortablePath(keyFileText.getText()));
checkFilePathAndManageIt();
}
});
keyPasswordText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
FTPConnection conn = getConnection();
conn.setKeystorePassword(conn.getValue(keyPasswordText.getText(), true));
}
});
connModelCombo.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setMode(connModelCombo.getText());
}
});
encodeCombo.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setEcoding(encodeCombo.getText());
if (CUSTOM.equals(getConnection().getEcoding())) {
customText.setVisible(true);
customText.setText(ENCODING);
getConnection().setCustomEncode(customText.getText());
} else {
getConnection().setCustomEncode(getConnection().getEcoding());
customText.setVisible(false);
}
}
});
customText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setCustomEncode(customText.getText());
}
});
methodCombo.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
FTPConnection conn = getConnection();
conn.setMethod(methodCombo.getText());
if (PUBLIC_KEY.equals(conn.getMethod())) {
privatekeyText.setVisible(true);
passphraseText.setVisible(true);
//$NON-NLS-1$
privatekeyText.setText(conn.getPrivatekey() != null ? conn.getPrivatekey() : "");
// decrypt password
passphraseText.setText(conn.getValue(conn.getPassphrase(), false));
} else {
privatekeyText.setVisible(false);
passphraseText.setVisible(false);
}
checkFieldsValue();
}
});
privatekeyText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
getConnection().setPrivatekey(PathUtils.getPortablePath(privatekeyText.getText()));
checkFilePathAndManageIt();
}
});
passphraseText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
FTPConnection conn = getConnection();
conn.setPassphrase(conn.getValue(passphraseText.getText(), true));
}
});
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class NameSection method createControls.
@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
super.createControls(parent, aTabbedPropertySheetPage);
composite = getWidgetFactory().createFlatFormComposite(parent);
FormData data;
//$NON-NLS-1$
nameText = getWidgetFactory().createText(composite, "");
data = new FormData();
data.left = new FormAttachment(0, STANDARD_LABEL_WIDTH);
data.right = new FormAttachment(50, 0);
data.top = new FormAttachment(0, ITabbedPropertyConstants.VSPACE);
nameText.setLayoutData(data);
addFocusListener(nameText);
nameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
IStatus status = evaluateTextField();
if (status.getSeverity() == IStatus.ERROR) {
errorLabel.setText(status.getMessage());
errorLabel.setVisible(true);
} else {
errorLabel.setVisible(false);
}
}
});
//$NON-NLS-1$
CLabel labelLabel = getWidgetFactory().createCLabel(composite, Messages.getString("NameSection.Name"));
data = new FormData();
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(nameText, -ITabbedPropertyConstants.HSPACE);
data.top = new FormAttachment(nameText, 0, SWT.CENTER);
labelLabel.setLayoutData(data);
//$NON-NLS-1$
errorLabel = getWidgetFactory().createCLabel(composite, "");
data = new FormData();
data.left = new FormAttachment(nameText, ITabbedPropertyConstants.HSPACE * 3);
data.right = new FormAttachment(100, 0);
data.top = new FormAttachment(nameText, 0, SWT.CENTER);
errorLabel.setLayoutData(data);
errorLabel.setImage(ImageProvider.getImage(EImage.ERROR_ICON));
errorLabel.setVisible(false);
addFocusListenerToChildren(composite);
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class NewImportProjectWizardPage method addListeners.
private void addListeners() {
nameText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
checkFieldsValue();
}
});
descriptionText.addModifyListener(new ModifyListener() {
@Override
public void modifyText(ModifyEvent e) {
checkFieldsValue();
}
});
languagePerlRadio.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkFieldsValue();
}
});
languageJavaRadio.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkFieldsValue();
}
});
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class NewProjectWizardPage method addListeners.
private void addListeners() {
nameText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
checkFieldsValue();
}
});
descriptionText.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
checkFieldsValue();
}
});
languagePerlRadio.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkFieldsValue();
}
});
languageJavaRadio.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
checkFieldsValue();
}
});
}
use of org.eclipse.swt.events.ModifyListener in project tdi-studio-se by Talend.
the class ErDiagramComposite method addErDiagramEditor.
/**
* admin Comment method "addErDiagramEditor".
*/
//$NON-NLS-1$
@SuppressWarnings("unchecked")
private void addErDiagramEditor(boolean isShowDesignerPage) {
GridData gridData = new GridData(GridData.FILL_BOTH);
this.setLayoutData(gridData);
GridLayout layout = new GridLayout();
layout.verticalSpacing = 0;
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
layout.numColumns = 1;
this.setLayout(layout);
editor = new ErdiagramDiagramEditor();
editor.createPartControl(this);
editor.getViewer().setContents(createErDiagram(isShowDesignerPage));
Control control = editor.getGraphicalControl();
if (control != null) {
control.setParent(this);
control.setLayoutData(gridData);
}
layout = new GridLayout();
layout.marginLeft = 0;
layout.marginRight = 0;
layout.marginBottom = 0;
layout.marginTop = 0;
layout.marginHeight = 0;
layout.marginWidth = 0;
gridData = new GridData(GridData.FILL_HORIZONTAL);
gridData.heightHint = 30;
int textstyle = SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL;
sqlText = new ColorStyledText(this, textstyle, CorePlugin.getDefault().getPreferenceStore(), language);
sqlText.setLayoutData(gridData);
//$NON-NLS-1$
sqlText.setText("");
sqlText.setBackground(getBackground());
sqlText.addModifyListener(new ModifyListener() {
/*
* (non-Javadoc)
*
* @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
*/
public void modifyText(ModifyEvent e) {
sqlString = sqlText.getText();
}
});
}
Aggregations