当前位置: 首页>>代码示例>>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;未经允许,请勿转载。