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


Java IDialogConstants.CANCEL_ID屬性代碼示例

本文整理匯總了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();
				}
			}
		});
	}
}
 
開發者ID:bsteker,項目名稱:bdf2,代碼行數:24,代碼來源:PropertyBrowser.java

示例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;
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:43,代碼來源:AddRemoveTypeHandler.java

示例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;
  }
}
 
開發者ID:ModelWriter,項目名稱:Tarski,代碼行數:44,代碼來源:AddRemoveTypeCommand.java


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