Search in sources :

Example 71 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project bndtools by bndtools.

the class WorkspaceLocationPart method createControl.

public Control createControl(final Composite parent) {
    // Create Controls
    group = new Group(parent, SWT.NONE);
    group.setText("Location");
    GridLayout layout = new GridLayout(3, false);
    group.setLayout(layout);
    File workspace = getUpdate();
    if (workspace == null) {
        final Button btnCreateInEclipseWorkspace = new Button(group, SWT.RADIO);
        btnCreateInEclipseWorkspace.setText("Create in current Eclipse Workspace");
        btnCreateInEclipseWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 3, 1));
        Label lblEclipseWorkspace = new Label(group, SWT.NONE);
        lblEclipseWorkspace.setText(ResourcesPlugin.getWorkspace().getRoot().getLocation().toOSString());
        lblEclipseWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
        final Button btnCreateExternal = new Button(group, SWT.RADIO);
        btnCreateExternal.setText("Create in:");
        final Text txtExternalLocation = new Text(group, SWT.BORDER);
        txtExternalLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        final Button btnBrowseExternal = new Button(group, SWT.PUSH);
        btnBrowseExternal.setText("Browse");
        updateFields = new Runnable() {

            @Override
            public void run() {
                btnCreateInEclipseWorkspace.setSelection(location.eclipseWorkspace);
                btnCreateExternal.setSelection(!location.eclipseWorkspace);
                txtExternalLocation.setText(location.externalPath != null ? location.externalPath : "");
            }
        };
        updateEnablement = new Runnable() {

            @Override
            public void run() {
                txtExternalLocation.setEnabled(!location.eclipseWorkspace);
                btnBrowseExternal.setEnabled(!location.eclipseWorkspace);
            }
        };
        // Load initial state
        updateFields.run();
        updateEnablement.run();
        // Event listeners
        final Listener locationListener = new Listener() {

            @Override
            public void handleEvent(Event ev) {
                modifyLock.modifyOperation(new Runnable() {

                    @Override
                    public void run() {
                        setLocation(new LocationSelection(btnCreateInEclipseWorkspace.getSelection(), txtExternalLocation.getText()));
                    }
                });
            }
        };
        btnCreateExternal.addListener(SWT.Selection, locationListener);
        btnCreateInEclipseWorkspace.addListener(SWT.Selection, locationListener);
        txtExternalLocation.addListener(SWT.Modify, locationListener);
        btnBrowseExternal.addSelectionListener(new SelectionAdapter() {

            @Override
            public void widgetSelected(SelectionEvent e) {
                DirectoryDialog dialog = new DirectoryDialog(parent.getShell());
                String path = dialog.open();
                if (path != null)
                    txtExternalLocation.setText(path);
            }
        });
    } else {
        final Label txtUpdateLocation = new Label(group, SWT.BORDER);
        txtUpdateLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
        txtUpdateLocation.setText("Update in current Bnd Workspace");
        Label lblEclipseWorkspace = new Label(group, SWT.NONE);
        lblEclipseWorkspace.setText(workspace.getAbsolutePath());
        lblEclipseWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
        setLocation(new LocationSelection(false, workspace.getAbsolutePath()));
    }
    return group;
}
Also used : Group(org.eclipse.swt.widgets.Group) PropertyChangeListener(java.beans.PropertyChangeListener) Listener(org.eclipse.swt.widgets.Listener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) File(java.io.File) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 72 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project bndtools by bndtools.

the class ProjectLocationGroup method createControl.

/**
     * @wbp.parser.entryPoint
     */
public Control createControl(Composite parent) {
    container = new Composite(parent, SWT.NONE);
    container.setLayout(new GridLayout(3, false));
    btnUseBndWorkspace = new Button(container, SWT.CHECK);
    btnUseBndWorkspace.setText("Use bnd workspace location");
    btnUseBndWorkspace.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1));
    lblOtherLocation = new Label(container, SWT.NONE);
    lblOtherLocation.setText("Location:");
    txtLocation = new Text(container, SWT.BORDER);
    txtLocation.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    txtLocation.setText("[WorkspaceLocation]");
    btnBrowse = new Button(container, SWT.NONE);
    btnBrowse.setText("Browse...");
    btnBrowse.setLayoutData(getButtonLayoutData(btnBrowse));
    updateUI();
    txtLocation.addModifyListener(new ModifyListener() {

        @Override
        public void modifyText(ModifyEvent e) {
            IPath oldValue = getLocation();
            if (!useBndWorkspace) {
                externalPath = txtLocation.getText();
            }
            IPath newValue = getLocation();
            if (!programmaticChange) {
                propSupport.firePropertyChange(PROP_LOCATION, oldValue, newValue);
                validate();
            }
        }
    });
    btnUseBndWorkspace.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            IPath oldValue = getLocation();
            useBndWorkspace = btnUseBndWorkspace.getSelection();
            IPath newValue = getLocation();
            if (!programmaticChange) {
                propSupport.firePropertyChange(PROP_LOCATION, oldValue, newValue);
                updateUI();
                validate();
            }
        }
    });
    btnBrowse.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog dialog = new DirectoryDialog(container.getShell());
            dialog.setMessage("Choose a directory for the project contents:");
            String directoryName = txtLocation.getText().trim();
            if (directoryName == null || directoryName.length() == 0) {
                String previous = JavaPlugin.getDefault().getDialogSettings().get(DIALOGSTORE_LAST_EXTERNAL_LOC);
                if (previous != null)
                    directoryName = previous;
            }
            assert (directoryName != null);
            if (directoryName.length() > 0) {
                File path = new File(directoryName);
                if (path.exists())
                    dialog.setFilterPath(directoryName);
            }
            String selected = dialog.open();
            if (selected != null) {
                IPath path = new Path(selected);
                if (projectName != null && !projectName.equals(path.lastSegment()))
                    selected = path.append(projectName).toString();
                txtLocation.setText(selected);
            }
        }
    });
    return container;
}
Also used : IPath(org.eclipse.core.runtime.IPath) Path(org.eclipse.core.runtime.Path) Composite(org.eclipse.swt.widgets.Composite) ModifyListener(org.eclipse.swt.events.ModifyListener) IPath(org.eclipse.core.runtime.IPath) 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 73 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project bndtools by bndtools.

the class ExecutableJarWizardPage method createControl.

/**
     * Create contents of the wizard.
     *
     * @param parent
     */
@Override
public void createControl(Composite parent) {
    Composite container = new Composite(parent, SWT.NULL);
    setControl(container);
    container.setLayout(new GridLayout(1, false));
    Group grpDestination = new Group(container, SWT.NONE);
    grpDestination.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    grpDestination.setText("Destination:");
    grpDestination.setLayout(new GridLayout(3, false));
    final Button btnJar = new Button(grpDestination, SWT.RADIO);
    btnJar.setText("Export to JAR:");
    btnJar.setSelection(jar);
    txtJarPath = new Text(grpDestination, SWT.BORDER);
    txtJarPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    txtJarPath.setText(jarPath != null ? jarPath : "");
    btnBrowseJar = new Button(grpDestination, SWT.NONE);
    btnBrowseJar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    btnBrowseJar.setText("Browse");
    final Button btnFolder = new Button(grpDestination, SWT.RADIO);
    btnFolder.setText("Export to folder:");
    btnFolder.setSelection(folder);
    txtFolderPath = new Text(grpDestination, SWT.BORDER);
    txtFolderPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    txtFolderPath.setText(folderPath != null ? folderPath : "");
    btnBrowseFolder = new Button(grpDestination, SWT.NONE);
    btnBrowseFolder.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
    btnBrowseFolder.setText("Browse");
    btnBrowseFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            DirectoryDialog dialog = new DirectoryDialog(getShell());
            String path = dialog.open();
            if (path != null)
                txtFolderPath.setText(path);
        }
    });
    loadLastExport();
    updateEnablement();
    validate();
    Listener listener = new Listener() {

        @Override
        public void handleEvent(Event event) {
            jar = btnJar.getSelection();
            jarPath = txtJarPath.getText();
            folder = btnFolder.getSelection();
            folderPath = txtFolderPath.getText();
            updateEnablement();
            validate();
        }
    };
    txtJarPath.addListener(SWT.Modify, listener);
    btnJar.addListener(SWT.Selection, listener);
    txtFolderPath.addListener(SWT.Modify, listener);
    btnFolder.addListener(SWT.Selection, listener);
    btnBrowseJar.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(getShell(), SWT.SAVE);
            dialog.setFilterExtensions(new String[] { "*.jar" });
            dialog.setFilterNames(new String[] { "JAR Files" });
            String path = dialog.open();
            if (path != null)
                txtJarPath.setText(path);
        }
    });
}
Also used : Group(org.eclipse.swt.widgets.Group) PropertyChangeListener(java.beans.PropertyChangeListener) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Text(org.eclipse.swt.widgets.Text) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) SelectionEvent(org.eclipse.swt.events.SelectionEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) FileDialog(org.eclipse.swt.widgets.FileDialog) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 74 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project eclipse.platform.swt by eclipse.

the class ClipboardExample method createFileTransfer.

void createFileTransfer(Composite copyParent, Composite pasteParent) {
    // File Transfer
    Label l = new Label(copyParent, SWT.NONE);
    // $NON-NLS-1$
    l.setText("FileTransfer:");
    GridData data = new GridData();
    data.verticalSpan = 3;
    l.setLayoutData(data);
    final Table copyFileTable = new Table(copyParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    data = new GridData(GridData.FILL_BOTH);
    data.widthHint = HSIZE;
    data.heightHint = VSIZE;
    data.verticalSpan = 3;
    copyFileTable.setLayoutData(data);
    Button b = new Button(copyParent, SWT.PUSH);
    b.setText("Select file(s)");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        FileDialog dialog = new FileDialog(shell, SWT.OPEN | SWT.MULTI);
        String result = dialog.open();
        if (result != null && result.length() > 0) {
            String path = dialog.getFilterPath();
            String[] names = dialog.getFileNames();
            for (String name : names) {
                TableItem item = new TableItem(copyFileTable, SWT.NONE);
                item.setText(path + File.separator + name);
            }
        }
    }));
    b = new Button(copyParent, SWT.PUSH);
    b.setText("Select directory");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        DirectoryDialog dialog = new DirectoryDialog(shell, SWT.OPEN);
        String result = dialog.open();
        if (result != null && result.length() > 0) {
            // copyFileTable.removeAll();
            TableItem item = new TableItem(copyFileTable, SWT.NONE);
            item.setText(result);
        }
    }));
    b = new Button(copyParent, SWT.PUSH);
    b.setText("Copy");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        TableItem[] items = copyFileTable.getItems();
        if (items.length > 0) {
            status.setText("");
            String[] itemsData = new String[items.length];
            for (int i = 0; i < itemsData.length; i++) {
                itemsData[i] = items[i].getText();
            }
            clipboard.setContents(new Object[] { itemsData }, new Transfer[] { FileTransfer.getInstance() });
        } else {
            status.setText("No file to copy");
        }
    }));
    l = new Label(pasteParent, SWT.NONE);
    // $NON-NLS-1$
    l.setText("FileTransfer:");
    final Table pasteFileTable = new Table(pasteParent, SWT.MULTI | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    data = new GridData(GridData.FILL_BOTH);
    data.widthHint = HSIZE;
    data.heightHint = VSIZE;
    pasteFileTable.setLayoutData(data);
    b = new Button(pasteParent, SWT.PUSH);
    b.setText("Paste");
    b.addSelectionListener(widgetSelectedAdapter(e -> {
        String[] textData = (String[]) clipboard.getContents(FileTransfer.getInstance());
        if (textData != null && textData.length > 0) {
            status.setText("");
            pasteFileTable.removeAll();
            for (String element : textData) {
                TableItem item = new TableItem(pasteFileTable, SWT.NONE);
                item.setText(element);
            }
        } else {
            status.setText("No file to paste");
        }
    }));
}
Also used : RTFTransfer(org.eclipse.swt.dnd.RTFTransfer) StyledText(org.eclipse.swt.custom.StyledText) Image(org.eclipse.swt.graphics.Image) Rectangle(org.eclipse.swt.graphics.Rectangle) ImageData(org.eclipse.swt.graphics.ImageData) Table(org.eclipse.swt.widgets.Table) GC(org.eclipse.swt.graphics.GC) Point(org.eclipse.swt.graphics.Point) Clipboard(org.eclipse.swt.dnd.Clipboard) ImageDataProvider(org.eclipse.swt.graphics.ImageDataProvider) SelectionListener.widgetSelectedAdapter(org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter) ImageTransfer(org.eclipse.swt.dnd.ImageTransfer) Composite(org.eclipse.swt.widgets.Composite) TextTransfer(org.eclipse.swt.dnd.TextTransfer) Canvas(org.eclipse.swt.widgets.Canvas) GridData(org.eclipse.swt.layout.GridData) FillLayout(org.eclipse.swt.layout.FillLayout) FileTransfer(org.eclipse.swt.dnd.FileTransfer) TableItem(org.eclipse.swt.widgets.TableItem) Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) Shell(org.eclipse.swt.widgets.Shell) Button(org.eclipse.swt.widgets.Button) FileDialog(org.eclipse.swt.widgets.FileDialog) Display(org.eclipse.swt.widgets.Display) Group(org.eclipse.swt.widgets.Group) File(java.io.File) Transfer(org.eclipse.swt.dnd.Transfer) SWT(org.eclipse.swt.SWT) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog) HTMLTransfer(org.eclipse.swt.dnd.HTMLTransfer) List(org.eclipse.swt.widgets.List) ScrolledComposite(org.eclipse.swt.custom.ScrolledComposite) ScrollBar(org.eclipse.swt.widgets.ScrollBar) Label(org.eclipse.swt.widgets.Label) GridLayout(org.eclipse.swt.layout.GridLayout) Table(org.eclipse.swt.widgets.Table) Button(org.eclipse.swt.widgets.Button) TableItem(org.eclipse.swt.widgets.TableItem) Label(org.eclipse.swt.widgets.Label) GridData(org.eclipse.swt.layout.GridData) RTFTransfer(org.eclipse.swt.dnd.RTFTransfer) ImageTransfer(org.eclipse.swt.dnd.ImageTransfer) TextTransfer(org.eclipse.swt.dnd.TextTransfer) FileTransfer(org.eclipse.swt.dnd.FileTransfer) Transfer(org.eclipse.swt.dnd.Transfer) HTMLTransfer(org.eclipse.swt.dnd.HTMLTransfer) FileDialog(org.eclipse.swt.widgets.FileDialog) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 75 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project eclipse.platform.swt by eclipse.

the class DialogTab method createControlWidgets.

/**
 * Creates the "Control" widget children.
 */
@Override
void createControlWidgets() {
    /* Create the combo */
    String[] strings = { ControlExample.getResourceString("ColorDialog"), ControlExample.getResourceString("DirectoryDialog"), ControlExample.getResourceString("FileDialog"), ControlExample.getResourceString("FontDialog"), ControlExample.getResourceString("PrintDialog"), ControlExample.getResourceString("MessageBox") };
    dialogCombo = new Combo(dialogStyleGroup, SWT.READ_ONLY);
    dialogCombo.setItems(strings);
    dialogCombo.setText(strings[0]);
    dialogCombo.setVisibleItemCount(strings.length);
    /* Create the create dialog button */
    createButton = new Button(dialogStyleGroup, SWT.NONE);
    createButton.setText(ControlExample.getResourceString("Create_Dialog"));
    createButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_CENTER));
    /* Create a group for the various dialog button style controls */
    Group buttonStyleGroup = new Group(controlGroup, SWT.NONE);
    buttonStyleGroup.setLayout(new GridLayout());
    buttonStyleGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    buttonStyleGroup.setText(ControlExample.getResourceString("Button_Styles"));
    /* Create the button style buttons */
    okButton = new Button(buttonStyleGroup, SWT.CHECK);
    okButton.setText("SWT.OK");
    cancelButton = new Button(buttonStyleGroup, SWT.CHECK);
    cancelButton.setText("SWT.CANCEL");
    yesButton = new Button(buttonStyleGroup, SWT.CHECK);
    yesButton.setText("SWT.YES");
    noButton = new Button(buttonStyleGroup, SWT.CHECK);
    noButton.setText("SWT.NO");
    retryButton = new Button(buttonStyleGroup, SWT.CHECK);
    retryButton.setText("SWT.RETRY");
    abortButton = new Button(buttonStyleGroup, SWT.CHECK);
    abortButton.setText("SWT.ABORT");
    ignoreButton = new Button(buttonStyleGroup, SWT.CHECK);
    ignoreButton.setText("SWT.IGNORE");
    /* Create a group for the icon style controls */
    Group iconStyleGroup = new Group(controlGroup, SWT.NONE);
    iconStyleGroup.setLayout(new GridLayout());
    iconStyleGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    iconStyleGroup.setText(ControlExample.getResourceString("Icon_Styles"));
    /* Create the icon style buttons */
    iconErrorButton = new Button(iconStyleGroup, SWT.RADIO);
    iconErrorButton.setText("SWT.ICON_ERROR");
    iconInformationButton = new Button(iconStyleGroup, SWT.RADIO);
    iconInformationButton.setText("SWT.ICON_INFORMATION");
    iconQuestionButton = new Button(iconStyleGroup, SWT.RADIO);
    iconQuestionButton.setText("SWT.ICON_QUESTION");
    iconWarningButton = new Button(iconStyleGroup, SWT.RADIO);
    iconWarningButton.setText("SWT.ICON_WARNING");
    iconWorkingButton = new Button(iconStyleGroup, SWT.RADIO);
    iconWorkingButton.setText("SWT.ICON_WORKING");
    noIconButton = new Button(iconStyleGroup, SWT.RADIO);
    noIconButton.setText(ControlExample.getResourceString("No_Icon"));
    /* Create a group for the modal style controls */
    Group modalStyleGroup = new Group(controlGroup, SWT.NONE);
    modalStyleGroup.setLayout(new GridLayout());
    modalStyleGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    modalStyleGroup.setText(ControlExample.getResourceString("Modal_Styles"));
    /* Create the modal style buttons */
    primaryModalButton = new Button(modalStyleGroup, SWT.RADIO);
    primaryModalButton.setText("SWT.PRIMARY_MODAL");
    applicationModalButton = new Button(modalStyleGroup, SWT.RADIO);
    applicationModalButton.setText("SWT.APPLICATION_MODAL");
    systemModalButton = new Button(modalStyleGroup, SWT.RADIO);
    systemModalButton.setText("SWT.SYSTEM_MODAL");
    /* Create a group for the file dialog style controls */
    Group fileDialogStyleGroup = new Group(controlGroup, SWT.NONE);
    fileDialogStyleGroup.setLayout(new GridLayout());
    fileDialogStyleGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    fileDialogStyleGroup.setText(ControlExample.getResourceString("File_Dialog_Styles"));
    /* Create the file dialog style buttons */
    openButton = new Button(fileDialogStyleGroup, SWT.RADIO);
    openButton.setText("SWT.OPEN");
    saveButton = new Button(fileDialogStyleGroup, SWT.RADIO);
    saveButton.setText("SWT.SAVE");
    multiButton = new Button(fileDialogStyleGroup, SWT.CHECK);
    multiButton.setText("SWT.MULTI");
    /* Create the orientation group */
    if (RTL_SUPPORT_ENABLE) {
        createOrientationGroup();
    }
    /* Create a group for other style and setting controls */
    Group otherGroup = new Group(controlGroup, SWT.NONE);
    otherGroup.setLayout(new GridLayout());
    otherGroup.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.VERTICAL_ALIGN_FILL));
    otherGroup.setText(ControlExample.getResourceString("Other"));
    /* Create the other style and setting controls */
    sheetButton = new Button(otherGroup, SWT.CHECK);
    sheetButton.setText("SWT.SHEET");
    usePreviousResultButton = new Button(otherGroup, SWT.CHECK);
    usePreviousResultButton.setText(ControlExample.getResourceString("Use_Previous_Result"));
    effectsVisibleButton = new Button(otherGroup, SWT.CHECK);
    effectsVisibleButton.setText("FontDialog.setEffectsVisible");
    /* Add the listeners */
    dialogCombo.addSelectionListener(widgetSelectedAdapter(event -> dialogSelected(event)));
    createButton.addSelectionListener(widgetSelectedAdapter(event -> createButtonSelected(event)));
    SelectionListener buttonStyleListener = widgetSelectedAdapter(event -> buttonStyleSelected(event));
    okButton.addSelectionListener(buttonStyleListener);
    cancelButton.addSelectionListener(buttonStyleListener);
    yesButton.addSelectionListener(buttonStyleListener);
    noButton.addSelectionListener(buttonStyleListener);
    retryButton.addSelectionListener(buttonStyleListener);
    abortButton.addSelectionListener(buttonStyleListener);
    ignoreButton.addSelectionListener(buttonStyleListener);
    /* Set default values for style buttons */
    okButton.setEnabled(false);
    cancelButton.setEnabled(false);
    yesButton.setEnabled(false);
    noButton.setEnabled(false);
    retryButton.setEnabled(false);
    abortButton.setEnabled(false);
    ignoreButton.setEnabled(false);
    iconErrorButton.setEnabled(false);
    iconInformationButton.setEnabled(false);
    iconQuestionButton.setEnabled(false);
    iconWarningButton.setEnabled(false);
    iconWorkingButton.setEnabled(false);
    noIconButton.setEnabled(false);
    saveButton.setEnabled(false);
    openButton.setEnabled(false);
    openButton.setSelection(true);
    multiButton.setEnabled(false);
    noIconButton.setSelection(true);
    effectsVisibleButton.setEnabled(false);
    effectsVisibleButton.setSelection(true);
}
Also used : Text(org.eclipse.swt.widgets.Text) Combo(org.eclipse.swt.widgets.Combo) Button(org.eclipse.swt.widgets.Button) PrinterData(org.eclipse.swt.printing.PrinterData) FileDialog(org.eclipse.swt.widgets.FileDialog) FontDialog(org.eclipse.swt.widgets.FontDialog) Group(org.eclipse.swt.widgets.Group) SelectionListener.widgetSelectedAdapter(org.eclipse.swt.events.SelectionListener.widgetSelectedAdapter) ColorDialog(org.eclipse.swt.widgets.ColorDialog) PrintDialog(org.eclipse.swt.printing.PrintDialog) SWT(org.eclipse.swt.SWT) FontData(org.eclipse.swt.graphics.FontData) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog) MessageBox(org.eclipse.swt.widgets.MessageBox) RGB(org.eclipse.swt.graphics.RGB) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GridData(org.eclipse.swt.layout.GridData) Widget(org.eclipse.swt.widgets.Widget) SelectionListener(org.eclipse.swt.events.SelectionListener) GridLayout(org.eclipse.swt.layout.GridLayout) Group(org.eclipse.swt.widgets.Group) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) Combo(org.eclipse.swt.widgets.Combo) SelectionListener(org.eclipse.swt.events.SelectionListener)

Aggregations

DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)88 SelectionEvent (org.eclipse.swt.events.SelectionEvent)51 Button (org.eclipse.swt.widgets.Button)49 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)48 GridData (org.eclipse.swt.layout.GridData)48 GridLayout (org.eclipse.swt.layout.GridLayout)47 Text (org.eclipse.swt.widgets.Text)47 Composite (org.eclipse.swt.widgets.Composite)42 Label (org.eclipse.swt.widgets.Label)40 Group (org.eclipse.swt.widgets.Group)27 File (java.io.File)25 ModifyListener (org.eclipse.swt.events.ModifyListener)22 ModifyEvent (org.eclipse.swt.events.ModifyEvent)21 Combo (org.eclipse.swt.widgets.Combo)21 FileDialog (org.eclipse.swt.widgets.FileDialog)11 TableViewer (org.eclipse.jface.viewers.TableViewer)8 Table (org.eclipse.swt.widgets.Table)8 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)7 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)7 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)7