本文整理匯總了Java中org.eclipse.jface.dialogs.MessageDialog.INFORMATION屬性的典型用法代碼示例。如果您正苦於以下問題:Java MessageDialog.INFORMATION屬性的具體用法?Java MessageDialog.INFORMATION怎麽用?Java MessageDialog.INFORMATION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.eclipse.jface.dialogs.MessageDialog
的用法示例。
在下文中一共展示了MessageDialog.INFORMATION屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: execute
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection sel = Activator.getDefault().getWorkbench().getActiveWorkbenchWindow()
.getSelectionService().getSelection();
if (sel instanceof ITreeSelection) {
ITreeSelection treeSel = (ITreeSelection) sel;
if (treeSel.getFirstElement() instanceof IFile) {
IFile file = (IFile) treeSel.getFirstElement();
List<IMarker> markers = MarkerFactory.findMarkers(file);
MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Marker Count", null,
markers.size() + " marker(s)", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
dialog.open();
}
}
return null;
}
示例2: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
this.candidateToTypeChanging = new ArrayList<IMarker>();
this.deleteMarkers();
this.refresh();
if (AlloyUtilities.isExists()) {
this.candidateToTypeChanging = new ArrayList<IMarker>();
this.deleteMarkers();
this.refresh();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例3: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
candidateToTypeChanging = new ArrayList<IMarker>();
file = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
.getEditorInput().getAdapter(IFile.class);
selection =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
selectedMarker = MarkUtilities.getLeaderOfMarker(getMarker());
addRemoveType();
if (Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getActivePage()
.findView(Visualization.ID) != null) {
Visualization.showViz();
}
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"Ok"}, 0);
infoDialog.open();
}
return null;
}
示例4: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
AlloyOtherSolutionReasoning.getInstance().finish();
if (AlloyUtilities.isExists()) {
candidateToTypeChanging = new ArrayList<IMarker>();
file = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor()
.getEditorInput().getAdapter(IFile.class);
selection =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
marker = getMarkerFromEditor();
deleteMarker();
refresh();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例5: execute
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
ISelection selection = MarkerFactory.getSelection();
if (selection instanceof ITreeSelection) {
ITreeSelection treeSelection = (ITreeSelection) selection;
if (treeSelection.getFirstElement() instanceof IOpenable
|| treeSelection.getFirstElement() instanceof IFile) {
IResource resource =
((IAdaptable) treeSelection.getFirstElement()).getAdapter(IResource.class);
List<IMarker> markers = MarkerFactory.findMarkers(resource);
MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Marker Count", null,
markers.size() + " marker(s)", MessageDialog.INFORMATION, new String[] {"OK"}, 0);
dialog.open();
}
}
return null;
}
示例6: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
MarkerMapping.getInstance().runWithSelection();
if (Activator.getDefault().getWorkbench().getWorkbenchWindows()[0].getActivePage()
.findView(Visualization.ID) != null) {
Visualization.showViz();
}
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例7: execute
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
this.file = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor().getEditorInput().getAdapter(IFile.class);
this.selection =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
this.createMarkersWs();
this.refresh();
} else {
MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(), "System Information",
null, "You dont have any registered alloy file to system.", MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例8: run
@Override
public void run() {
if (AlloyUtilities.isExists()) {
if (this.marker != null && this.marker.exists()) {
MappingCommand.chooseForAction(this.marker);
} 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();
}
} else {
final MessageDialog infoDialog = new MessageDialog(Activator.getShell(), "System Information",
null, "You dont have any registered alloy file to system.", MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
infoDialog.open();
}
}
示例9: removeType
private void removeType(IMarker selectedMarker) {
selectedMarker = AnnotationFactory.convertAnnotationType(selectedMarker, true, true,
AlloyUtilities.getTotalTargetCount(selectedMarker));
IMarker marker = null;
for (int i = 1; i < candidateToTypeChanging.size(); i++) {
marker = candidateToTypeChanging.get(i);
AnnotationFactory.convertAnnotationType(marker, true,
MarkUtilities.compare(marker, selectedMarker),
AlloyUtilities.getTotalTargetCount(marker));
}
AlloyUtilities.removeAllRelationsOfMarker(selectedMarker);
AlloyUtilities.removeRelationOfMarker(selectedMarker);
if (MarkUtilities.getGroupId(selectedMarker) != null) {
final List<IMarker> group = MarkerFactory.findMarkersByGroupId(selectedMarker.getResource(),
MarkUtilities.getGroupId(selectedMarker));
for (final IMarker iMarker : group) {
AlloyUtilities.removeTypeFromMarker(iMarker);
MarkUtilities.setType(iMarker, null);
}
} else {
AlloyUtilities.removeTypeFromMarker(selectedMarker);
MarkUtilities.setType(selectedMarker, null);
}
final MessageDialog removeSuccessDialog = new MessageDialog(MarkerActivator.getShell(),
"Removing Type Action", null, "Selected marker's type has been removed.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
removeSuccessDialog.open();
}
示例10: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final MessageDialog warningDialog = new MessageDialog(MarkerActivator.getShell(), "Warning!",
null, "You are about to delete all markers! Do you want to continue?",
MessageDialog.WARNING, new String[] {"Yes", "No"}, 0);
if (warningDialog.open() != 0) {
return null;
}
if (AlloyUtilities.isExists()) {
AlloyOtherSolutionReasoning.getInstance().finish();
AlloyUtilities.clearRepository();
AlloyUtilities.clearRelation();
AlloyUtilities.clearSigs();
AlloyUtilities.clearFields();
try {
ResourcesPlugin.getWorkspace().getRoot().deleteMarkers(MarkerFactory.MARKER_MARKING, true,
IResource.DEPTH_INFINITE);
} catch (final CoreException e) {
e.printStackTrace();
}
refreshActiveEditor();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例11: execute
@Override
public Object execute(ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
this.createMarkers();
this.refresh();
} else {
MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(), "System Information",
null, "You dont have any registered alloy file to system.", MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例12: execute
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
if (AlloyUtilities.isExists()) {
createMarker();
refresh();
} else {
final MessageDialog infoDialog = new MessageDialog(MarkerActivator.getShell(),
"System Information", null, "You dont have any registered alloy file to system.",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
infoDialog.open();
}
return null;
}
示例13: run
private void run() {
if (MarkerMapping.marker != null && MarkerMapping.marker.exists()) {
chooseForAction(MarkerMapping.marker);
} 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();
}
}
示例14: convertToMarkerType
private MarkerTypeElement convertToMarkerType(final Sig rootSig) {
if (rootSig instanceof PrimSig) {
final PrimSig primSig = (PrimSig) rootSig;
MarkerTypeElement rootType;
if (primSig.isAbstract != null) {
rootType = new MarkerTypeElement(
primSig.toString().substring(primSig.toString().indexOf("/") + 1) + " {abs}");
} else {
rootType = new MarkerTypeElement(
primSig.toString().substring(primSig.toString().indexOf("/") + 1));
}
try {
if (primSig.children().isEmpty()) {
return rootType;
} else {
for (int i = 0; i < primSig.children().size(); i++) {
rootType.getChildren().add(this.convertToMarkerType(primSig.children().get(i)));
}
return rootType;
}
} catch (final Err e) {
final MessageDialog dialog =
new MessageDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(),
"Alloy Error Information", null, e.getMessage(), MessageDialog.INFORMATION,
new String[] {"OK"}, 0);
dialog.open();
}
} else if (rootSig instanceof SubsetSig) {
final SubsetSig subsetSig = (SubsetSig) rootSig;
String parentName = subsetSig.type().toString();
parentName = parentName.substring(parentName.indexOf("/") + 1, parentName.length() - 1);
final MarkerTypeElement parentMarkerType =
this.getMarkTypeElementByName(parentName, this.types);
parentMarkerType.getChildren().add(new MarkerTypeElement(
subsetSig.toString().substring(subsetSig.toString().indexOf("/") + 1)));
}
return null;
}
示例15: deleteMarkers
private void deleteMarkers() {
this.editor =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
this.file = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
.getActiveEditor().getEditorInput().getAdapter(IFile.class);
this.selection =
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getSelectionService().getSelection();
try {
final IMarker beDeleted = this.getMarker();
if (beDeleted != null && beDeleted.exists()) {
final MessageDialog warningDialog =
new MessageDialog(MarkerActivator.getShell(), "Warning!", null,
"If you delete markers, all relations of these markers has been removed! Do you want to continue to delete markers?",
MessageDialog.WARNING, new String[] {"YES", "NO"}, 0);
if (warningDialog.open() != 0) {
return;
}
this.findCandidateToTypeChangingMarkers(beDeleted);
final String sourceIdOfSelectedMarker = MarkUtilities.getSourceId(beDeleted);
for (final IMarker iMarker : this.candidateToTypeChanging) {
AnnotationFactory.convertAnnotationType(iMarker, true,
MarkUtilities.compare(MarkUtilities.getSourceId(iMarker), sourceIdOfSelectedMarker),
AlloyUtilities.getTotalTargetCount(iMarker));
}
final String markerText = MarkUtilities.getText(beDeleted);
if (MarkUtilities.getGroupId(beDeleted) != null) {
final String markerGroupId = MarkUtilities.getGroupId(beDeleted);
final List<IMarker> markers =
MarkerFactory.findMarkersByGroupId(this.file, markerGroupId);
for (int i = markers.size() - 1; i >= 0; i--) {
this.deleteFromAlloyXML(markers.get(i));
AnnotationFactory.removeAnnotation(markers.get(i));
markers.get(i).delete();
}
} else {
this.deleteFromAlloyXML(beDeleted);
AnnotationFactory.removeAnnotation(beDeleted);
beDeleted.delete();
}
final MessageDialog dialog =
new MessageDialog(MarkerActivator.getShell(), "Mark will be deleted by this wizard",
null, "\"" + markerText + "\" has been selected to be unmarked",
MessageDialog.INFORMATION, new String[] {"OK"}, 0);
dialog.open();
}
} catch (final CoreException e) {
e.printStackTrace();
}
}