Search in sources :

Example 31 with ModifyEvent

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();
        }
    });
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text)

Example 32 with ModifyEvent

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);
            }
        }
    });
}
Also used : Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) File(java.io.File) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 33 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class ToolsPreferencePage method createMemoryGroup.

/**
     * Creates the memory group.
     * 
     * @param parent
     *            The parent composite
     */
private void createMemoryGroup(Composite parent) {
    Group group = new Group(parent, SWT.NONE);
    group.setText(Messages.memoryGroupLabel);
    GridLayout layout = new GridLayout(2, false);
    group.setLayout(layout);
    group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label label = new Label(group, SWT.NONE);
    label.setText(Messages.maxNumberOfClassesLabel);
    maxNumberOfClassesText = new Text(group, SWT.BORDER);
    maxNumberOfClassesText.setText(String.valueOf(getPreferenceStore().getInt(IConstants.MAX_CLASSES_NUMBER)));
    maxNumberOfClassesText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            validateMaxNumberOfClasses();
        }
    });
    maxNumberOfClassesText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
}
Also used : Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text)

Example 34 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class InfoPage method createSnapshotSection.

/**
     * Creates the snapshot section.
     * 
     * @param parent The parent composite
     * @param toolkit The toolkit
     */
private void createSnapshotSection(Composite parent, FormToolkit toolkit) {
    ExpandableComposite section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR);
    section.setText(Messages.snapshotSectionLabel);
    section.setLayoutData(new GridData(GridData.FILL_BOTH));
    Composite composite = toolkit.createComposite(section);
    section.setClient(composite);
    composite.setLayout(new GridLayout(2, false));
    dateText = createText(composite, toolkit, Messages.dateLabel);
    commentsText = createEditableText(composite, toolkit, Messages.commentsLabel);
    commentsText.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            editor.firePropertyChange(IEditorPart.PROP_DIRTY);
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) ExpandableComposite(org.eclipse.ui.forms.widgets.ExpandableComposite)

Example 35 with ModifyEvent

use of org.eclipse.swt.events.ModifyEvent in project tdi-studio-se by Talend.

the class JavaMonitorPreferencePage method createUpdatePeriodText.

/**
     * Creates the update period text field.
     * 
     * @param parent The parent composite
     */
private void createUpdatePeriodText(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout(2, false));
    composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    Label label = new Label(composite, SWT.NONE);
    label.setText(Messages.updatePeriodLabel);
    updatePeriodText = new Text(composite, 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();
        }
    });
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) ModifyEvent(org.eclipse.swt.events.ModifyEvent) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) GridData(org.eclipse.swt.layout.GridData) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text)

Aggregations

ModifyEvent (org.eclipse.swt.events.ModifyEvent)297 ModifyListener (org.eclipse.swt.events.ModifyListener)296 GridData (org.eclipse.swt.layout.GridData)200 Text (org.eclipse.swt.widgets.Text)177 GridLayout (org.eclipse.swt.layout.GridLayout)175 Composite (org.eclipse.swt.widgets.Composite)162 Label (org.eclipse.swt.widgets.Label)156 SelectionEvent (org.eclipse.swt.events.SelectionEvent)155 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)126 Button (org.eclipse.swt.widgets.Button)93 Combo (org.eclipse.swt.widgets.Combo)61 Group (org.eclipse.swt.widgets.Group)47 SelectionListener (org.eclipse.swt.events.SelectionListener)37 File (java.io.File)27 KeyEvent (org.eclipse.swt.events.KeyEvent)27 StyledText (org.eclipse.swt.custom.StyledText)23 DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)21 FocusEvent (org.eclipse.swt.events.FocusEvent)19 Point (org.eclipse.swt.graphics.Point)19 FileDialog (org.eclipse.swt.widgets.FileDialog)18