本文整理汇总了Java中org.eclipse.swt.SWT.ICON_QUESTION属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.ICON_QUESTION属性的具体用法?Java SWT.ICON_QUESTION怎么用?Java SWT.ICON_QUESTION使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.ICON_QUESTION属性的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: reset
public void reset() {
JavelinConnector javelinConnector = (JavelinConnector) connector;
Javelin javelin = javelinConnector.javelin;
int emulatorID = (int) javelinConnector.emulatorID;
switch (emulatorID) {
case Session.EmulIDSNA:
case Session.EmulIDAS400:
MessageBox messageBox = new MessageBox(getShell(), SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION
| SWT.APPLICATION_MODAL);
String message = "This will send a KEY_RESET to the emulator.";
messageBox.setMessage(message);
int ret = messageBox.open();
if (ret == SWT.OK) {
javelin.doAction("KEY_RESET");
Engine.logEmulators
.info("KEY_RESET has been sent to the emulator, because of an user request.");
}
break;
default:
ConvertigoPlugin
.warningMessageBox("The Reset function is only available for IBM emulators (3270 and AS/400).");
break;
}
}
示例3: toolSelected
@Override
public void toolSelected() {
Sketch sketch = AvoGlobal.project.getActiveSketch();
if(sketch == null || sketch.isConsumed){
MessageBox m = new MessageBox(AvoGlobal.menuet.getShell(), SWT.ICON_QUESTION | SWT.OK);
m.setMessage( "You must select an unconsumed sketch before\n" +
"any 2Dto3D operations can be performed.\n\n" +
"Please create a new sketch or select one\n" +
"by double-clicking on it in the project's\n" +
"list of elements.");
m.setText("Please select a sketch");
m.open();
}else{
// there is a sketch active!
changeMenuetToolMode(Menuet.MENUET_MODE_BUILD);
// TODO: Building should not be done in the view!!
sketch.buildRegions();
int i = AvoGlobal.project.getActivePart().addNewFeat2D3D(sketch.getUniqueID());
AvoGlobal.project.getActivePart().setActiveSubPart(i);
}
}
示例4: 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;
}
示例5: 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;
}
}
示例6: detectVariables
/** SQL TRANSACTION **/
private void detectVariables( String queries, String oldQueries,
List<RequestableVariable> listVariables ){
if (queries != null && !queries.equals("")) {
// We create an another List which permit to compare and update variables
Set<String> newSQLQueriesVariablesNames = getSetVariableNames(queries);
Set<String> oldSQLQueriesVariablesNames = getSetVariableNames(oldQueries);
// Modify variables definition if needed
if ( listVariables != null &&
!oldSQLQueriesVariablesNames.equals(newSQLQueriesVariablesNames) ) {
for ( RequestableVariable variable : listVariables ) {
String variableName = variable.getName();
if (oldSQLQueriesVariablesNames.contains(variableName) &&
!newSQLQueriesVariablesNames.contains(variableName)) {
try {
MessageBox messageBox = new MessageBox(viewer.getControl().getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
messageBox.setMessage("Do you really want to delete the variable \""+variableName+"\"?");
messageBox.setText("Delete \""+variableName+"\"?");
if (messageBox.open() == SWT.YES) {
variable.delete();
}
} catch (EngineException e) {
ConvertigoPlugin.logException(e, "Error when deleting the variable \""+variableName+"\"");
}
}
}
}
}
}
示例7: run
public void run() {
Display display = Display.getDefault();
Cursor waitCursor = new Cursor(display, SWT.CURSOR_WAIT);
Shell shell = getParentShell();
shell.setCursor(waitCursor);
try {
ProjectExplorerView explorerView = getProjectExplorerView();
if (explorerView != null) {
TraceTreeObject traceObject = (TraceTreeObject)explorerView.getFirstSelectedTreeObject();
MessageBox messageBox = new MessageBox(shell,SWT.YES | SWT.NO | SWT.CANCEL | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
String message = java.text.MessageFormat.format("Do you really want to delete the trace \"{0}\"?", new Object[] {traceObject.getName()});
messageBox.setMessage(message);
if (messageBox.open() == SWT.YES) {
File file = (File) traceObject.getObject();
if (file.exists()) {
if (file.delete()) {
TreeParent treeParent = traceObject.getParent();
treeParent.removeChild(traceObject);
explorerView.refreshTreeObject(treeParent);
}
else {
throw new Exception("Unable to delete file \""+ file.getAbsolutePath() + "\"");
}
}
}
}
}
catch (Throwable e) {
ConvertigoPlugin.logException(e, "Unable to delete the trace file!");
}
finally {
shell.setCursor(null);
waitCursor.dispose();
}
}
示例8: toolSelected
@Override
public void toolSelected() {
MessageBox m = new MessageBox(AvoGlobal.menuet.getShell(), SWT.ICON_QUESTION | SWT.YES | SWT.NO);
m.setMessage("Are you sure you want to discard ALL changes\nand exit the Sketch drawing mode?");
m.setText("Discard ALL Changes?");
if(m.open() == SWT.YES){
Sketch sketch = AvoGlobal.project.getActiveSketch();
if(sketch != null){
sketch.deselectAllFeat2D();
}
changeMenuetToolMode(Menuet.MENUET_MODE_PART);
AvoGlobal.glView.updateGLView = true;
}
}
示例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: createMessageBox
private void createMessageBox(){
Shell shell=container.getShell();
int style = SWT.APPLICATION_MODAL | SWT.OK | SWT.CANCEL | SWT.ICON_QUESTION;
messageBox = new MessageBox(shell,style);
messageBox.setText("Confirm"); //$NON-NLS-1$
messageBox.setMessage(Messages.MessageBeforeClosingWindow);
}
示例11: 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();
}
示例12: 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;
}
示例13: saveChanges
public int saveChanges(String msg) {
MessageBox messageBox = new MessageBox(shell, SWT.ICON_QUESTION | SWT.YES | SWT.NO | SWT.CANCEL);
messageBox.setMessage(msg);
messageBox.setText("Save Changes");
return messageBox.open();
}
示例14: 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;
}
示例15: findDatabaseObject
protected void findDatabaseObject() {
enumDatabaseObjects = Collections.enumeration(vDatabaseObjects);
while (true) {
while (enumDatabaseObjects.hasMoreElements()) {
DatabaseObjectTreeObject databaseObjectTreeObject = (DatabaseObjectTreeObject) enumDatabaseObjects.nextElement();
DatabaseObject databaseObject = databaseObjectTreeObject.getObject();
boolean bContinue = false;
switch(objectType) {
case 0: // *
bContinue = true;
break;
case 1: // Screen class
bContinue = databaseObject.getDatabaseType().equals("ScreenClass");
break;
case 2: // Criteria
bContinue = databaseObject.getDatabaseType().equals("Criteria");
break;
case 3: // Extraction rule
bContinue = databaseObject.getDatabaseType().equals("ExtractionRule");
break;
case 4: // Sheet
bContinue = databaseObject.getDatabaseType().equals("Sheet");
break;
case 5: // Transaction
bContinue = databaseObject.getDatabaseType().equals("Transaction");
break;
case 6: // Statement
bContinue = databaseObject.getDatabaseType().equals("Statement");
break;
case 7: // Sequence
bContinue = databaseObject.getDatabaseType().equals("Sequence");
break;
case 8: // Step
bContinue = databaseObject.getDatabaseType().equals("Step");
break;
}
if (bContinue) {
String text = databaseObjectTreeObject.toString();
if (!bMatchCase) {
objectTextSubstring = objectTextSubstring.toLowerCase();
text = text.toLowerCase();
}
if (text.indexOf(objectTextSubstring) != -1) { // Object found !!!
ConvertigoPlugin.getDefault().getProjectExplorerView().objectSelected(new CompositeEvent(databaseObject));
vDatabaseObjects.remove(databaseObjectTreeObject);
return;
}
}
}
MessageBox messageBox = new MessageBox(getShell(),SWT.YES | SWT.NO | SWT.ICON_QUESTION | SWT.APPLICATION_MODAL);
String message = "The end of the document has been reached. Do you want to retry the search from the beginning of the document?";
messageBox.setMessage(message);
int ret = messageBox.open();
if (ret == SWT.YES) {
getDatabaseObjects(null);
}
else {
return;
}
}
}