当前位置: 首页>>代码示例>>Java>>正文


Java MessageDialog.INFORMATION属性代码示例

本文整理汇总了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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:16,代码来源:CountMarkersInFileHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:DeleteAllHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:25,代码来源:AddRemoveTypeHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:24,代码来源:DeleteHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:17,代码来源:CountMarkersInResourceHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:16,代码来源:MappingHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:18,代码来源:MarkAllInWorkspaceHandler.java

示例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();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:18,代码来源:MappingCommand.java

示例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();
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:29,代码来源:AddRemoveTypeHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:33,代码来源:DeleteAllTraceElementsHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:13,代码来源:MarkAllHandler.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:13,代码来源:MarkHandler.java

示例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();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:10,代码来源:MarkerMapping.java

示例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;
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:38,代码来源:AlloyParserForMetamodel.java

示例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();
  }
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:55,代码来源:DeleteAllHandler.java


注:本文中的org.eclipse.jface.dialogs.MessageDialog.INFORMATION属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。