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


Java MessageDialog.ERROR属性代码示例

本文整理汇总了Java中org.eclipse.jface.dialogs.MessageDialog.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java MessageDialog.ERROR属性的具体用法?Java MessageDialog.ERROR怎么用?Java MessageDialog.ERROR使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.eclipse.jface.dialogs.MessageDialog的用法示例。


在下文中一共展示了MessageDialog.ERROR属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: launch

private void launch(Object[] elements, String mode) {
	try {
		IJavaElement[] ijes = null;
		List<IJavaElement> jes =  new ArrayList<IJavaElement>();
		for (int i = 0; i < elements.length; i++) {
			Object selected= elements[i];
			if (selected instanceof IJavaElement) {
				IJavaElement element= (IJavaElement) selected;
				switch (element.getElementType()) {
					case IJavaElement.COMPILATION_UNIT:
						jes.add(element);
						break;
				}
			}
		
		}
		ijes = new IJavaElement[jes.size()];
		jes.toArray(ijes);
		ILaunchConfigurationWorkingCopy wc = buildLaunchConfiguration(ijes);
		if (wc==null) return;
		ILaunchConfiguration config= findExistingORCreateLaunchConfiguration(wc, mode);
		DebugUITools.launch(config, mode);
	} catch (Exception e) {
		ResourceManager.logException(e);
		MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(), "GW4E Launcher", (Image)null, "Unable to launch. See error in Error view.", MessageDialog.ERROR, new String[] { "Close" }, 0);
		dialog.open();
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:28,代码来源:GW4ELaunchShortcut.java

示例2: buildLaunchConfiguration

protected ILaunchConfigurationWorkingCopy buildLaunchConfiguration(IJavaElement[]  elements) throws CoreException {
	IJavaElement mainElement = null;
	for (int i = 0; i < elements.length; i++) {
		IJavaElement element = elements [i];
		if (JDTManager.hasStartableGraphWalkerAnnotation(element)) {
			mainElement = element;
			break;
		}
	}

	if (mainElement==null) {
	   MessageDialog dialog = new MessageDialog(Display.getCurrent().getActiveShell(), "GW4E Launcher", (Image)null, MessageUtil.getString("nostartvalueinannotation"), MessageDialog.ERROR, new String[] { "Close" }, 0);
	   dialog.open();
	   return null;
	}
	 
	ILaunchConfigurationType configType= DebugPlugin.getDefault().getLaunchManager().getLaunchConfigurationType(GW4ELAUNCHCONFIGURATIONTYPE);
	ILaunchConfigurationWorkingCopy wc= configType.newInstance(null, DebugPlugin.getDefault().getLaunchManager().generateLaunchConfigurationName(mainElement.getElementName()));
	wc.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROJECT_NAME, elements[0].getJavaProject().getElementName());
	
	String mainElementName = elementToJavaClassName (mainElement);
	StringBuffer sb = new StringBuffer (mainElementName).append(";");
	String[] classnames = elementToJavaClassName(elements);
	for (int i = 0; i < classnames.length; i++) {
		if (classnames[i].equals(mainElementName)) continue;
		sb.append(classnames[i]).append(";");
	}
	wc.setAttribute(LaunchingConstant.CONFIG_TEST_CLASSES,sb.toString());
	return wc;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:30,代码来源:GW4ELaunchShortcut.java

示例3: displayErrorMessage

/**
 * Display an error message in a Dialog
 * 
 * @param message
 */
public static void displayErrorMessage(String title, String message) {
	MessageDialog dialog = new MessageDialog(Display.getDefault().getActiveShell(),
			title, null, message,
			MessageDialog.ERROR, new String[] { MessageUtil.getString("close") }, 0);
	int result = dialog.open();
	dialog.close();
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:12,代码来源:DialogManager.java

示例4: Message_Dialog

/**
 * 
 * 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,代码行数:15,代码来源:HiveFieldDialogHelper.java

示例5: errorDialogOK

public static MessageDialog errorDialogOK(String title, String message) {
  return new MessageDialog(getShell(), title, null, message, MessageDialog.ERROR, 0, "Yes", "No");
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:3,代码来源:Activator.java

示例6: errorDialogYESNO

public static MessageDialog errorDialogYESNO(String title, String message) {
  return new MessageDialog(getShell(), title, null, message, MessageDialog.ERROR, 0, "Yes", "No");
}
 
开发者ID:ModelWriter,项目名称:Tarski,代码行数:3,代码来源:Activator.java


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