當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。