本文整理汇总了Java中org.eclipse.jface.dialogs.IDialogConstants.CANCEL_ID属性的典型用法代码示例。如果您正苦于以下问题:Java IDialogConstants.CANCEL_ID属性的具体用法?Java IDialogConstants.CANCEL_ID怎么用?Java IDialogConstants.CANCEL_ID使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.dialogs.IDialogConstants
的用法示例。
在下文中一共展示了IDialogConstants.CANCEL_ID属性的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buttonPressed
protected void buttonPressed(int buttonId) {
if (IDialogConstants.OK_ID == buttonId) {
okPressed();
} else if (IDialogConstants.CANCEL_ID == buttonId) {
cancelPressed();
} else if (UPDATE_ID == buttonId) {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
try {
propEditor.updatePropertyBrowser();
treeViewer.setInput(XmlReader.loadXmlReader(path));
} catch (Exception e) {
e.printStackTrace();
// TODO: handle exception
} finally {
treeViewer.refresh();
}
}
});
}
}
示例2: addRemoveType
private void addRemoveType() {
if (!MarkerPage.isParsed()) {
final MessageDialog parseCtrlDialog =
new MessageDialog(MarkerActivator.getShell(), "Type Information", null,
"You dont have any marker type registered to system! \n"
+ "Please parse an alloy file first",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
parseCtrlDialog.open();
return;
}
final ActionSelectionDialog actionSelectionDialog =
new ActionSelectionDialog(MarkerActivator.getShell());
actionSelectionDialog.open();
if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
return;
}
if (selectedMarker != null && selectedMarker.exists()) {
findCandidateToTypeChangingMarkers(selectedMarker);
if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
addType(selectedMarker);
} else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
final MessageDialog warningDialog =
new MessageDialog(MarkerActivator.getShell(), "Warning!", null,
"If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
MessageDialog.WARNING, new String[] {"Yes", "No"}, 0);
final int returnCode = warningDialog.open();
if (returnCode != 0) {
return;
}
removeType(selectedMarker);
}
// MarkerUpdater.updateTargets(selectedMarker);
// MarkerUpdater.updateSources(selectedMarker);
} else {
final MessageDialog dialog =
new MessageDialog(MarkerActivator.getShell(), "There is no marker in this position", null,
"Please select valid marker", MessageDialog.INFORMATION, new String[] {"Ok"}, 0);
dialog.open();
return;
}
}
示例3: addRemoveType
private void addRemoveType() {
if (!MarkerPage.isParsed()) {
final MessageDialog parseCtrlDialog =
new MessageDialog(Activator.getShell(), "Type Information", null,
"You dont have any marker type registered to system! \n"
+ "Please parse an alloy file first",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
parseCtrlDialog.open();
return;
}
final ActionSelectionDialog actionSelectionDialog =
new ActionSelectionDialog(Activator.getShell());
actionSelectionDialog.open();
if (actionSelectionDialog.getReturnCode() == IDialogConstants.CANCEL_ID) {
return;
}
IMarker selectedMarker = this.marker;
selectedMarker = MarkUtilities.getLeaderOfMarker(selectedMarker);
if (selectedMarker != null && selectedMarker.exists()) {
this.findCandidateToTypeChangingMarkers(selectedMarker);
if (actionSelectionDialog.getReturnCode() == IDialogConstants.YES_ID) {
AddRemoveTypeCommand.addType(selectedMarker);
} else if (actionSelectionDialog.getReturnCode() == IDialogConstants.NO_ID) {
final MessageDialog warningDialog =
new MessageDialog(Activator.getShell(), "Warning!", null,
"If you remove marker's type, all relations of this marker has been removed! Do you want to continue to remove marker's type?",
MessageDialog.WARNING, new String[] {"YES", "NO"}, 0);
final int returnCode = warningDialog.open();
if (returnCode != 0) {
return;
}
this.removeType(selectedMarker);
}
} else {
final MessageDialog dialog =
new MessageDialog(Activator.getShell(), "There is no marker in this position", null,
"Please select valid marker", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
dialog.open();
return;
}
}