Search in sources :

Example 1 with DirectoryDialog

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

the class DefaultInteraction method selectDirectory.

public File selectDirectory(String message) {
    DirectoryDialog saveDialog = new DirectoryDialog(window);
    saveDialog.setMessage(message);
    String path = saveDialog.open();
    if (path != null) {
        return new File(path);
    }
    return null;
}
Also used : File(java.io.File) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 2 with DirectoryDialog

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

the class DesignEditorInteraction method askForImageDir.

public String askForImageDir() {
    DirectoryDialog dialog = new DirectoryDialog(window);
    dialog.setText(L10N.get("DE.SelectImages", "Select a directory of images"));
    // XXX: Is there a way to get the following formatted decently? To
    //      see the end of the message you have to make the dialog bigger.
    //      Note that embedded linefeeds do *not* work: the second line
    //      gets truncated to just its top couple of pixels.
    dialog.setMessage(L10N.get("DE.DirectoryOfImages", "Select a directory with a set of images (.JPG, .PNG or .GIF) to import."));
    return dialog.open();
}
Also used : DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 3 with DirectoryDialog

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

the class DefaultInteraction method askUserForDirectory.

/**TODO
     * Creates a directory chooser dialog, with the appropriate messages
     * about what the user should be trying to do.
     */
public String askUserForDirectory(String title, String message) {
    DirectoryDialog dialog = new DirectoryDialog(window);
    dialog.setText(title);
    dialog.setMessage(message);
    return dialog.open();
}
Also used : DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 4 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project jop by jop-devel.

the class JOPMainTab method handleFileOutputDirectoryButtonSelected.

/**
     * Prompts the user to choose a location from the filesystem and
     * sets the location as the full path of the selected file.
     */
protected void handleFileOutputDirectoryButtonSelected() {
    DirectoryDialog dialog = new DirectoryDialog(getShell(), SWT.SAVE);
    dialog.setMessage("Select a directory to place JOPized files");
    dialog.setFilterPath(fJOPizedOutputText.getText());
    String directory = dialog.open();
    if (directory != null) {
        fJOPizedOutputText.setText(directory);
    }
}
Also used : DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Example 5 with DirectoryDialog

use of org.eclipse.swt.widgets.DirectoryDialog in project dbeaver by serge-rider.

the class NavigatorHandlerCreateLink method execute.

@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
    final ISelection selection = HandlerUtil.getCurrentSelection(event);
    if (selection instanceof IStructuredSelection) {
        final IStructuredSelection structSelection = (IStructuredSelection) selection;
        Object element = structSelection.getFirstElement();
        if (!(element instanceof DBNResource)) {
            return null;
        }
        final IResource resource = ((DBNResource) element).getResource();
        if (resource instanceof IFolder) {
            final IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
            DirectoryDialog dialog = new DirectoryDialog(workbenchWindow.getShell(), SWT.NONE);
            String folder = dialog.open();
            if (folder != null) {
                createLink(workbenchWindow, (IFolder) resource, folder);
            }
        }
    }
    return null;
}
Also used : DBNResource(org.jkiss.dbeaver.model.navigator.DBNResource) IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IResource(org.eclipse.core.resources.IResource) IFolder(org.eclipse.core.resources.IFolder) DirectoryDialog(org.eclipse.swt.widgets.DirectoryDialog)

Aggregations

DirectoryDialog (org.eclipse.swt.widgets.DirectoryDialog)68 SelectionEvent (org.eclipse.swt.events.SelectionEvent)48 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)46 GridData (org.eclipse.swt.layout.GridData)43 Button (org.eclipse.swt.widgets.Button)43 Text (org.eclipse.swt.widgets.Text)43 GridLayout (org.eclipse.swt.layout.GridLayout)42 Composite (org.eclipse.swt.widgets.Composite)38 Label (org.eclipse.swt.widgets.Label)36 Group (org.eclipse.swt.widgets.Group)23 File (java.io.File)21 ModifyEvent (org.eclipse.swt.events.ModifyEvent)21 ModifyListener (org.eclipse.swt.events.ModifyListener)21 Combo (org.eclipse.swt.widgets.Combo)18 TableViewer (org.eclipse.jface.viewers.TableViewer)8 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)7 FileDialog (org.eclipse.swt.widgets.FileDialog)7 Table (org.eclipse.swt.widgets.Table)7 ArrayContentProvider (org.eclipse.jface.viewers.ArrayContentProvider)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)6