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;
}
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();
}
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();
}
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);
}
}
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;
}
Aggregations