本文整理汇总了Java中org.eclipse.swt.SWT.SHEET属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.SHEET属性的具体用法?Java SWT.SHEET怎么用?Java SWT.SHEET使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.SHEET属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: handleLocationBrowseButtonSelected
private void handleLocationBrowseButtonSelected() {
String selectedDirectory = null;
String dirName = getPathFromLocationField();
if (dirName != null && !dirName.equals("")) {
File dir = new File(dirName);
if (!dir.exists()) {
dirName = "";
}
}
if (dirName == null || dirName.equals("")) {
String value = getDialogSettings().get(SAVED_LOCATION_ATTR);
if (value != null) {
dirName = value;
}
}
DirectoryDialog dialog = new DirectoryDialog(projectLocation.getShell(), SWT.SHEET);
dialog.setMessage("Select the location directory");
dialog.setFilterPath(dirName);
selectedDirectory = dialog.open();
if (selectedDirectory != null) {
updateLocationField(selectedDirectory);
getDialogSettings().put(SAVED_LOCATION_ATTR, selectedDirectory);
}
}
示例2: queryYesNoQuestion
/**
* Displays a Yes/No question to the user with the specified message and returns the user's response.
*
* @param message
* the question to ask
* @return <code>true</code> for Yes, and <code>false</code> for No
*/
private boolean queryYesNoQuestion(String message) {
MessageDialog dialog = new MessageDialog(getContainer().getShell(),
IDEWorkbenchMessages.Question,
(Image) null, message, MessageDialog.NONE,
new String[] { IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL }, 0) {
@Override
protected int getShellStyle() {
return super.getShellStyle() | SWT.SHEET;
}
};
return dialog.open() == 0;
}
示例3: handleDestinationBrowseButtonPressed
/**
* Open an appropriate destination browser so that the user can specify a source to import from
*/
private void handleDestinationBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(getContainer().getShell(),
SWT.SAVE | SWT.SHEET);
dialog.setMessage(N4ExportMessages.FileExport_selectDestinationMessage);
dialog.setText(N4ExportMessages.FileExport_selectDestinationTitle);
dialog.setFilterPath(getTargetDirectory());
String selectedDirectoryName = dialog.open();
if (selectedDirectoryName != null) {
setErrorMessage(null);
setDestinationValue(selectedDirectoryName);
}
}
示例4: handleDestinationBrowseButtonPressed
/**
* Open an appropriate destination browser so that the user can specify a source to import from
*/
protected void handleDestinationBrowseButtonPressed() {
DirectoryDialog dialog = new DirectoryDialog(getContainer().getShell(),
SWT.SAVE | SWT.SHEET);
dialog.setMessage("Select npm destination folder");
dialog.setText("Select npm destination folder");
dialog.setFilterPath(getDestinationValue());
String selectedDirectoryName = dialog.open();
if (selectedDirectoryName != null) {
setError(null, null);
setDestinationValue(selectedDirectoryName);
}
}
示例5: queryOverwrite
/**
* The default implementation of this <code>IOverwriteQuery</code> method asks the user whether the existing
* resource at the given path should be overwritten.
*
* @param pathString
* the path of the archive
* @return the user's reply: one of <code>"YES"</code>, <code>"NO"</code>, <code>"ALL"</code>, or
* <code>"CANCEL"</code>
*/
@Override
public String queryOverwrite(String pathString) {
IPath path = Path.fromOSString(pathString);
String messageString;
// Break the message up if there is a file name and a directory
// and there are at least 2 segments.
if (path.getFileExtension() == null || path.segmentCount() < 2) {
messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_existsQuestion, pathString);
} else {
messageString = NLS.bind(IDEWorkbenchMessages.WizardDataTransfer_overwriteNameAndPathQuestion,
path.lastSegment(),
path.removeLastSegments(1).toOSString());
}
final MessageDialog dialog = new MessageDialog(getContainer()
.getShell(), IDEWorkbenchMessages.Question,
null, messageString, MessageDialog.QUESTION, new String[] {
IDialogConstants.YES_LABEL,
IDialogConstants.YES_TO_ALL_LABEL,
IDialogConstants.NO_LABEL,
IDialogConstants.NO_TO_ALL_LABEL,
IDialogConstants.CANCEL_LABEL }, 0) {
@Override
protected int getShellStyle() {
return super.getShellStyle() | SWT.SHEET;
}
};
String[] response = new String[] { YES, ALL, NO, NO_ALL, CANCEL };
// run in syncExec because callback is from an operation,
// which is probably not running in the UI thread.
getControl().getDisplay().syncExec(new Runnable() {
@Override
public void run() {
dialog.open();
}
});
return dialog.getReturnCode() < 0 ? CANCEL : response[dialog.getReturnCode()];
}