當前位置: 首頁>>代碼示例>>Java>>正文


Java MessageDialog.open方法代碼示例

本文整理匯總了Java中org.eclipse.jface.dialogs.MessageDialog.open方法的典型用法代碼示例。如果您正苦於以下問題:Java MessageDialog.open方法的具體用法?Java MessageDialog.open怎麽用?Java MessageDialog.open使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.dialogs.MessageDialog的用法示例。


在下文中一共展示了MessageDialog.open方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:17,代碼來源:CountMarkersInFileHandler.java

示例2: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:18,代碼來源:DeleteAllHandler.java

示例3: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:18,代碼來源:CountMarkersInResourceHandler.java

示例4: nextPressed

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@Override
public boolean nextPressed() throws Exception {
  // if save enabled, make sure pred has a name that not starts with number
  if (saveEnabled && (Character.isDigit(getPredName().charAt(0)) || getPredName().isEmpty())) {
    predText.forceFocus();
    return false;
  }

  String predName = getPredName();
  if (!saveEnabled)
    predName = "temp_pred_name";

  A4Solution solution =
      getAlloyToEMF().executePred(predName, generatePredAndRun(predName), saveEnabled);
  if (solution != null) {
    AlloySolutionSelectionPage nextPage = (AlloySolutionSelectionPage) getNextPage();
    nextPage.setFirstSolution(solution);
    return true;
  } else {
    MessageDialog messageDialog = new MessageDialog(getShell(), "Error", null,
        "No instance found, try changing the bounds.", MessageDialog.INFORMATION, 0,
        new String[] {"OK"});
    messageDialog.open();
    return false;
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:27,代碼來源:BoundSelectionPage.java

示例5: open

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@Override
public void open() {

  final IFile file = MarkerActivator.getEditor().getEditorInput().getAdapter(IFile.class);

  final int start = this.fUrlRegion.getOffset();
  final int end = this.fUrlRegion.getOffset() + this.fUrlRegion.getLength();
  final IMarker beMapped = MarkerFactory.findMarkerWithAbsolutePosition(file, start, end);

  if (beMapped != null) {
    MarkerMapping.getInstance().runWithMarker(beMapped);
  } else {
    final MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Mark Information",
        null, "Something goes wrong with this text fragments", MessageDialog.WARNING,
        new String[] {"OK"}, 0);
    dialog.open();
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:19,代碼來源:MarkerMappingActionHyperlink.java

示例6: run

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:19,代碼來源:MappingCommand.java

示例7: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
  final MessageDialog warningdialog =
      new MessageDialog(MarkerActivator.getShell(), "Mark Information", null,
          "If new alloy file will be parsed , your all marker type will be lost !",
          MessageDialog.WARNING, new String[] {"OK", "Cancel"}, 0);
  if (warningdialog.open() != 0) {
    return null;
  }

  final String filePath = getFilePath();
  if (filePath == null) {
    return null;
  }
  AlloyParseUtil.parse(filePath);

  try {
    TraceManager.get().loadSpec(filePath);
  } catch (final TraceException e) {
    e.printStackTrace();
  }
  return null;
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:24,代碼來源:LoadSpecificationHandler.java

示例8: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:17,代碼來源:MappingHandler.java

示例9: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:14,代碼來源:MarkHandler.java

示例10: openWizardForModule

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
 * Opens the wizard with the given id and passes it the selection.
 *
 * @param wizardId
 *            The wizard id of the eclipse newWizard registry
 * @param selection
 *            The selection
 */
private void openWizardForModule(String wizardId, IStructuredSelection selection, boolean nested) {

	// Retrieve wizard from registry
	IWizardDescriptor wizardDescriptor = PlatformUI.getWorkbench().getNewWizardRegistry().findWizard(wizardId);

	if (wizardDescriptor == null) {
		return;
	}

	try {
		IWorkbenchWizard wizard = wizardDescriptor.createWizard();

		// Inject wizard members
		injector.injectMembers(wizard);

		// Create and open a new wizard dialog
		WizardDialog wizardDialog = new WizardDialog(UIUtils.getShell(), wizard);

		// If the wizard supports it, enable in module option
		if (wizard instanceof N4JSNewClassifierWizard<?>) {
			((N4JSNewClassifierWizard<?>) wizard).init(PlatformUI.getWorkbench(), selection, nested);
		} else {
			// Otherwise just pass it the initial selection
			wizard.init(PlatformUI.getWorkbench(), selection);
		}

		// wizardDialog.setTitle(wizard.getWindowTitle());
		wizardDialog.open();

	} catch (CoreException e) {
		/** Failed to create the wizard */
		Shell workbenchShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
		MessageDialog.open(MessageDialog.ERROR, workbenchShell, "Failed to launch wizard",
				String.format("Failed to launch wizard %s", wizardId), SWT.SHEET);
		return;
	}

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:47,代碼來源:CreateNewN4JSElementInModuleHandler.java

示例11: execute

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
@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,代碼行數:14,代碼來源:MarkAllHandler.java

示例12: createMarkersWs

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
private void createMarkersWs() {
  ITextSelection textSelection = (ITextSelection) this.selection;
  if (MarkerFactory.findMarkerWithAbsolutePosition(this.file, textSelection.getOffset(),
      textSelection.getOffset() + textSelection.getLength()) != null) {
    MessageDialog dialog = new MessageDialog(MarkerActivator.getShell(), "Mark Information", null,
        "In these area, there is already a marker", MessageDialog.WARNING, new String[] {"OK"},
        0);
    dialog.open();
    return;
  } else {
    MarkAllInWsWizard markAllWsWizard = new MarkAllInWsWizard(textSelection, this.file);
    WizardDialog selectionDialog = new WizardDialog(MarkerActivator.getShell(), markAllWsWizard);
    selectionDialog.open();
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:16,代碼來源:MarkAllInWorkspaceHandler.java

示例13: removeType

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
private void removeType(IMarker selectedMarker) {
  selectedMarker = AnnotationFactory.convertAnnotationType(selectedMarker, true, true,
      AlloyUtilities.getTotalTargetCount(selectedMarker));

  IMarker marker = null;
  for (int i = 1; i < this.candidateToTypeChanging.size(); i++) {
    marker = this.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(Activator.getShell(),
      "Removing Type Action", null, "Selected marker's type has been removed.",
      MessageDialog.INFORMATION, new String[] {"OK"}, 0);
  removeSuccessDialog.open();
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:31,代碼來源:AddRemoveTypeCommand.java

示例14: displayYesNoQuestion

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
public static int displayYesNoQuestion(String title, String text) {
	if (isAutomatedMode ()) return getIntegerAutomatedModeDefaultValue();
	MessageDialog dialog = new MessageDialog(null, title, null, text, MessageDialog.QUESTION,
			new String[] { MessageUtil.getString("yes"), MessageUtil.getString("no") }, 0);
	int result = dialog.open();
	return result;
}
 
開發者ID:gw4e,項目名稱:gw4e.project,代碼行數:8,代碼來源:DialogManager.java

示例15: Message_Dialog

import org.eclipse.jface.dialogs.MessageDialog; //導入方法依賴的package包/類
/**
 * 
 * Message dialog to be displayed if compare_fields() method returns false. 
 * 
 */
public int Message_Dialog()
{
	
	
		MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(), "Rearrange Fields", null,
		    Messages.HIVE_PARTI_SEQ_ERROR, MessageDialog.ERROR, new String[] { "Rearrange Schema",
		  "Rearrange Partition Fields" }, 0);
		int result = dialog.open();
		return result;
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:16,代碼來源:HiveFieldDialogHelper.java


注:本文中的org.eclipse.jface.dialogs.MessageDialog.open方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。