本文整理汇总了Java中org.eclipse.swt.SWT.YES属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.YES属性的具体用法?Java SWT.YES怎么用?Java SWT.YES使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.YES属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: closeTranscription
/**
* @return true if the transcription was closed, false if the operation was
* cancelled
*/
protected boolean closeTranscription() {
if (!textEditor.isDisposed()) {
if (textEditor.isChanged()) {
MessageBox diag = new MessageBox(shell,
SWT.APPLICATION_MODAL | SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
diag.setMessage("You have unsaved changes, would you like to save them?");
int opt = diag.open();
if (opt == SWT.YES)
saveTranscription();
if (opt == SWT.CANCEL)
return false;
}
textEditor.clear();
transcriptionFile = null;
}
return true;
}
示例2: removeCordovaDirectory
/***
* Dialog yes/no which ask to user if we want
* remove the cordova directory present into "_private" directory
* We also explain, what we do and how to recreate the cordova environment
*/
public void removeCordovaDirectory() {
String mobilePlatformName = mobilePlatform.getName();
if (parentShell != null) {
MessageBox customDialog = new MessageBox(parentShell, SWT.ICON_INFORMATION | SWT.YES | SWT.NO);
customDialog.setText("Remove cordova directory");
customDialog.setMessage("Do you want to remove the Cordova directory located in \"_private\\localbuild\\" +
mobilePlatformName + "\" directory?\n\n" +
"It will also remove this project's Cordova environment!\n\n" +
"To recreate the project's Cordova environment, you just need to run a new local build."
);
if (customDialog.open() == SWT.YES) {
buildLocally.removeCordovaDirectory();
} else {
return;
}
} else {
//TODO
}
}
示例3: createXmlFilesForPastedJobFiles
private void createXmlFilesForPastedJobFiles(List<IFile> pastedFileList) {
for (IFile file : pastedFileList) {
try(InputStream inputStream=file.getContents()) {
Container container = (Container) CanvasUtils.INSTANCE.fromXMLToObject(inputStream);
IPath path = file.getFullPath().removeFileExtension().addFileExtension(XML);
IFile xmlFile = ResourcesPlugin.getWorkspace().getRoot().getFile(path);
if(xmlFile.exists()){
int userInput = showErrorMessage(xmlFile,xmlFile.getName()+" already exists.Do you want to replace it?");
if (userInput == SWT.YES) {
ConverterUtil.INSTANCE.convertToXML(container, true, xmlFile, null);
}
}
else {
ConverterUtil.INSTANCE.convertToXML(container, true, xmlFile, null);
}
} catch (CoreException | InstantiationException | IllegalAccessException | InvocationTargetException
| NoSuchMethodException | IOException exception) {
logger.error("Error while generating xml files for pasted job files", exception);
}
}
}
示例4: confirmationFromUser
private boolean confirmationFromUser() {
/*MessageDialog messageDialog = new MessageDialog(Display.getCurrent().getActiveShell(),Messages.CONFIRM_FOR_GRAPH_PROPS_RUN_JOB_TITLE, null,
Messages.CONFIRM_FOR_GRAPH_PROPS_RUN_JOB, MessageDialog.QUESTION, new String[] { "Yes",
"No" }, 0);*/
MessageBox dialog = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
dialog.setText(Messages.CONFIRM_FOR_GRAPH_PROPS_RUN_JOB_TITLE);
dialog.setMessage(Messages.CONFIRM_FOR_GRAPH_PROPS_RUN_JOB);
int response = dialog.open();
if(response == 0){
return true;
} else {
return false;
}
}
示例5: showMessageForGeneratingUniqueJobId
/**
* Create a Message Box displays a currentJob UniqueId and a message to
* generate new Unique Id.
* @param container
* @param jobFile
* @param isSubjob
* @return {@link Integer}
*/
private int showMessageForGeneratingUniqueJobId(Container container, IFile jobFile, boolean isSubJob) {
int buttonId = SWT.NO;
if(StringUtils.isBlank(container.getUniqueJobId())){
return SWT.YES;
}
MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
SWT.ICON_QUESTION | SWT.YES | SWT.NO);
messageBox.setText("Question");
String previousUniqueJobId = container.getUniqueJobId();
if (isSubJob) {
messageBox.setMessage(Messages.bind(Messages.GENERATE_NEW_UNIQUE_JOB_ID_FOR_SUB_JOB, jobFile.getName(),
previousUniqueJobId));
} else {
messageBox.setMessage(
Messages.bind(Messages.GENERATE_NEW_UNIQUE_JOB_ID_FOR_JOB, jobFile.getName(), previousUniqueJobId));
}
buttonId = messageBox.open();
return buttonId;
}
示例6: getValue
public Object getValue() {
TVObject tvSelected = (TVObject) ((IStructuredSelection) viewer.getSelection()).getFirstElement();
if (tvSelected != null) {
sourcedObjectName = tvSelected.getTargetName();
}
else if (selectedTVObject != null) {
if (SWT.YES == ConvertigoPlugin.questionMessageBox(parentDialog.getShell(), "Do you want to clear the previously sourced object ?")) {
sourcedObjectName = "";
}
}
return sourcedObjectName;
}
示例7: getExitConfirmation
/**
* @return true, if the user choosed OK in the exit dialog
*
* @author Rene Leonhardt
*/
private static boolean getExitConfirmation(boolean for_restart) {
MessageBoxShell mb = new MessageBoxShell(SWT.ICON_WARNING | SWT.YES
| SWT.NO, for_restart ? "MainWindow.dialog.restartconfirmation"
: "MainWindow.dialog.exitconfirmation", (String[]) null);
mb.open(null);
return mb.waitUntilClosed() == SWT.YES;
}
示例8: cancelPressed
@Override
protected void cancelPressed() {
if (isAnyUpdatePerformed) {
int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO |SWT.ICON_INFORMATION;
MessageBox messageBox = new MessageBox(getShell(), style);
messageBox.setText(INFORMATION); //$NON-NLS-1$
messageBox.setMessage(Messages.MessageBeforeClosingWindow);
if (messageBox.open() == SWT.YES) {
closeDialog = super.close();
}
} else {
closeDialog = super.close();
}
}
示例9: showYesNoDialog
/**
* Display a dialog box with the question icon and a yes/no button selection.
*/
public static int showYesNoDialog(Shell shell, String title, String message) {
MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO);
messageBox.setText(title);
messageBox.setMessage(message);
return messageBox.open();
}
示例10: hasOutputMappingInTableChanged
private Boolean hasOutputMappingInTableChanged() {
boolean returnValue = false;
populateCurrentItemsOfTable();
if (currentItems.length == 0 && previousItems.length == 0) {
super.close();
} else {
if (!Arrays.equals(currentItems, previousItems)) {
int style = SWT.APPLICATION_MODAL | SWT.YES | SWT.NO | SWT.ICON_INFORMATION;
MessageBox messageBox = new MessageBox(new Shell(), style);
messageBox.setText(INFORMATION);
messageBox.setMessage(Messages.MessageBeforeClosingWindow);
if (messageBox.open() == SWT.YES) {
joinOutputList.clear();
LookupMapProperty[] lookupMapPropertyObjects = new LookupMapProperty[previousItems.length];
for (int i = 0; i < previousItems.length; i++) {
if(!previousItems[i].isDisposed())
{
lookupMapPropertyObjects[i] = (LookupMapProperty) previousItems[i].getData();
joinOutputList.add(lookupMapPropertyObjects[i]);
}
}
getLookupPropertyGrid();
returnValue = super.close();
}
} else {
returnValue = super.close();
}
}
return returnValue;
}
示例11: notConfirmedByUser
private boolean notConfirmedByUser() {
MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_QUESTION | SWT.YES
| SWT.NO);
messageBox.setMessage(Messages.CONFIRM_TO_CREATE_SUBJOB_MESSAGE);
messageBox.setText(Messages.CONFIRM_TO_CREATE_SUBJOB_WINDOW_TITLE);
int response = messageBox.open();
if (response == SWT.YES) {
return false;
} else
return true;
}
示例12: showMessageBox
private void showMessageBox(IFile iFile, ByteArrayOutputStream out, String message) throws CoreException {
MessageBox messageBox = new MessageBox(Display.getCurrent().getActiveShell(),
SWT.ICON_ERROR | SWT.YES | SWT.NO);
messageBox.setText("Error");
messageBox.setMessage(message);
int status = messageBox.open();
if (status == SWT.YES) {
iFile.setContents(new ByteArrayInputStream(out.toByteArray()), true, false, null);
}
}
示例13: messageDialog
private int messageDialog() {
MessageBox box = new MessageBox(Display.getCurrent().getActiveShell(), SWT.ICON_QUESTION | SWT.YES
| SWT.CANCEL | SWT.NO);
box.setMessage(Messages.TOOL_EXT_MESSAGE);
box.setText(Messages.TOOL_EXIT_MESSAGE_BOX_TITLE);
return box.open();
}
示例14: isFinishSelectionOK
@Override
public boolean
isFinishSelectionOK()
{
String save_path = wizard.savePath;
File f = new File( save_path );
if ( f.isFile()){
MessageBox mb = new MessageBox(wizard.getWizardWindow(),SWT.ICON_QUESTION | SWT.YES | SWT.NO);
mb.setText(MessageText.getString("exportTorrentWizard.process.outputfileexists.title"));
mb.setMessage(MessageText.getString("exportTorrentWizard.process.outputfileexists.message"));
int result = mb.open();
if( result == SWT.NO ){
return( false );
}
}
return( true );
}
示例15: save
/**
* Saves a project.
*
* @return <code>false</code> if the save process has been canceled by user.
*/
public boolean save(boolean bDialog) {
boolean ret = true;
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = display.getActiveShell();
if (shell != null) {
shell.setCursor(waitCursor);
try {
if (hasChanged()) {
Project project = getObject();
String projectName = project.getName();
int response = SWT.YES;
if (bDialog) {
MessageBox messageBox = new MessageBox(shell,SWT.YES | SWT.NO | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
messageBox.setMessage("The project \"" + projectName + "\" has not been saved. Do you want to save your work now?");
response = messageBox.open();
}
if (response == SWT.YES) {
ConvertigoPlugin.logInfo("Saving the project '" + projectName + "'");
Engine.theApp.databaseObjectsManager.exportProject(project);
hasBeenModified(false);
ConvertigoPlugin.logInfo("Project '" + projectName + "' saved!");
getIProject().refreshLocal(IResource.DEPTH_ONE, null);
}
}
} catch (Exception e) {
ConvertigoPlugin.logException(e, "Unable to save the project!");
ConvertigoPlugin.logInfo("Project NOT saved!");
} finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
return ret;
}