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


Java ErrorDialog.openError方法代码示例

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


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

示例1: openResults

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * You can override this method to provide custom opening of
 * results if required.
 *
 * @param bean
 */
protected void openResults(StatusBean bean) {

	if (bean == null) return;

	for (IResultHandler handler : getResultsHandlers()) {
		if (handler.isHandled(bean)) {
			try {
				boolean ok = handler.open(bean);
				if (ok) return;
			} catch (Exception e) {
				ErrorDialog.openError(getSite().getShell(), "Internal Error", handler.getErrorMessage(null),
						new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
			}
		}
	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:StatusQueueView.java

示例2: getResultsHandlers

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
private List<IResultHandler> getResultsHandlers() {
	if (resultsHandlers == null) {
		final IConfigurationElement[] configElements = Platform.getExtensionRegistry()
				.getConfigurationElementsFor(RESULTS_HANDLER_EXTENSION_POINT_ID);
		final List<IResultHandler> handlers = new ArrayList<>(configElements.length + 1);
		for (IConfigurationElement configElement : configElements) {
			try {
				final IResultHandler handler = (IResultHandler) configElement.createExecutableExtension("class");
				handler.init(service, createConsumerConfiguration());
				handlers.add(handler);
			} catch (Exception e) {
				ErrorDialog.openError(getSite().getShell(), "Internal Error",
						"Could not create results handler for class " + configElement.getAttribute("class") +
						".\n\nPlease contact your support representative.",
						new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
			}
		}
		handlers.add(new DefaultResultsHandler());
		resultsHandlers = handlers;
	}
	return resultsHandlers;
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:StatusQueueView.java

示例3: rerun

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
private void rerun(StatusBean bean) {

		try {
			final DateFormat format = DateFormat.getDateTimeInstance();
			boolean ok = MessageDialog.openQuestion(getViewSite().getShell(), "Confirm resubmission "+bean.getName(),
					  "Are you sure you want to rerun "+bean.getName()+" submitted on "+format.format(new Date(bean.getSubmissionTime()))+"?");

			if (!ok) return;

			final StatusBean copy = bean.getClass().newInstance();
			copy.merge(bean);
			copy.setUniqueId(UUID.randomUUID().toString());
			copy.setMessage("Rerun of "+bean.getName());
			copy.setStatus(org.eclipse.scanning.api.event.status.Status.SUBMITTED);
			copy.setPercentComplete(0.0);
			copy.setSubmissionTime(System.currentTimeMillis());

			queueConnection.submit(copy, true);

			reconnect();

		} catch (Exception e) {
			ErrorDialog.openError(getViewSite().getShell(), "Cannot rerun "+bean.getName(), "Cannot rerun "+bean.getName()+"\n\nPlease contact your support representative.",
					new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
		}
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:27,代码来源:StatusQueueView.java

示例4: togglePausedConsumer

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
protected void togglePausedConsumer(IAction pauseConsumer) {

		// The button can get out of sync if two clients are used.
		final boolean currentState = queueConnection.isQueuePaused(getSubmissionQueueName());
		try {
			pauseConsumer.setChecked(!currentState); // We are toggling it.

			IPublisher<PauseBean> pauser = service.createPublisher(getUri(), IEventService.CMD_TOPIC);
			pauser.setStatusSetName(IEventService.CMD_SET); // The set that other clients may check
			pauser.setStatusSetAddRequired(true);

			PauseBean pbean = new PauseBean();
			pbean.setQueueName(getSubmissionQueueName()); // The queue we are pausing
			pbean.setPause(pauseConsumer.isChecked());
			pauser.broadcast(pbean);

		} catch (Exception e) {
			ErrorDialog.openError(getViewSite().getShell(), "Cannot pause queue "+getSubmissionQueueName(), "Cannot pause queue "+getSubmissionQueueName()+"\n\nPlease contact your support representative.",
					new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage()));
		}
		pauseConsumer.setChecked(queueConnection.isQueuePaused(getSubmissionQueueName()));
	}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:StatusQueueView.java

示例5: mouseUp

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (e.getSource() instanceof Button) {
		Button sel = (Button) e.getSource();
		if (sel.getText().equalsIgnoreCase("Save")) {
			try {
				String tempText = util.processAdd(isEdit, editName, comp, type, editor.getDocumentProvider().getDocument(getEditorInput()).get());
				editor.getDocumentProvider().getDocument(getEditorInput()).set(tempText);
				createPage1();
				setActivePage(1);
			} catch (JAXBException ex) {
				ErrorDialog.openError(getSite().getShell(), "Error removing item", null, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Error removing item", null));
			}
		}
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:TypesEditor.java

示例6: mouseUp

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
@Override
public void mouseUp(MouseEvent e) {
	if (e.getSource() instanceof Button) {
		Button sel = (Button) e.getSource();
		if (sel.getText().equalsIgnoreCase("Save")) {
			try {
				String tempText = sUtil.processAdd(isEdit, editName, comp, type, editor.getDocumentProvider().getDocument(getEditorInput()).get());
				editor.getDocumentProvider().getDocument(getEditorInput()).set(tempText);
				createPage1();
				setActivePage(1);
			} catch (JAXBException ex) {
				ErrorDialog.openError(getSite().getShell(), "Error removing item", null, new Status(IStatus.ERROR, PlatformUI.PLUGIN_ID, 0, "Error removing item", null));
			}
		}
	}
}
 
开发者ID:dstl,项目名称:Open_Source_ECOA_Toolset_AS5,代码行数:17,代码来源:ServicesEditor.java

示例7: save

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * Stash using appropriate messages to the user.
 * @param models
 * @param shell
 */
@Override
public void save(Object object) {
	try {

		if (file.exists()) {
			boolean ok = MessageDialog.openConfirm(Display.getCurrent().getActiveShell(), "Confirm Overwrite", "Are you sure that you would like to overwrite '"+file.getName()+"'?");
			if (!ok) return;
		}

		stash(object);

	} catch (Exception e) {
		ErrorDialog.openError(Display.getCurrent().getActiveShell(), "Error Saving Information", "An exception occurred while writing the "+getStashName()+" to file.",
				              new Status(IStatus.ERROR, "org.eclipse.scanning.device.ui", e.getMessage()));
	    logger.error("Error Saving Information", e);
	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:Stashing.java

示例8: openQueueMonitor

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
public static void openQueueMonitor(Class<? extends StatusBean> beanClass,
		                           final String queueName,
		                           final String topicName,
		                           final String submissionQueueName,
		                           String partName) throws PartInitException, UnsupportedEncodingException {

	String bundle = FrameworkUtil.getBundle(beanClass).getSymbolicName();
	String bean   = beanClass.getName();
	String sqn    = queueName;
	String stn    = topicName;
	String submit = submissionQueueName;

	String queueViewId = QueueViews.createSecondaryId(CommandConstants.getScanningBrokerUri(), bundle,bean, sqn, stn, submit);
	if (partName!=null) queueViewId = queueViewId+"partName="+partName;
	try {
		PageUtil.getPage().showView(QueueViews.getQueueViewID(), queueViewId, IWorkbenchPage.VIEW_ACTIVATE);
	} catch (PartInitException e) {
		ErrorDialog.openError(Display.getDefault().getActiveShell(), "Cannot open view", "Cannot open view "+queueViewId,
				new Status(Status.ERROR, "org.eclipse.scanning.event.ui", e.getMessage()));
		throw e;
	}
}
 
开发者ID:eclipse,项目名称:scanning,代码行数:23,代码来源:ViewUtil.java

示例9: okPressed

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
@Override
protected void okPressed() {
    final ICommand saveCommand = new ResourceChangingCommand(new SaveCompareInputCommand(input));
    final IStatus status = new CommandExecutor().execute(saveCommand);

    if (status.isOK()) {
        /*
         * If the input is our CustomCompareEditorInput, then call the
         * setOkPressed method. Otherwise, this is a 3.2-style
         * CompareEditorInput from Eclipse (which did not have the
         * okPressed() method), so just do a noop.
         */
        if (input instanceof CustomCompareEditorInput) {
            ((CustomCompareEditorInput) input).setOKPressed();
        }

        super.okPressed();
    } else {
        ErrorDialog.openError(getShell(), Messages.getString("CompatibleCompareDialog.DialogTitle"), null, status); //$NON-NLS-1$
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:22,代码来源:CompatibleCompareDialog.java

示例10: handleAction

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
private void handleAction(String problemType) {
	Optional<BookmarkProblem> bookmarkProblem = bookmarkProblems.getBookmarkProblem(bookmarkId, problemType);
	if (!bookmarkProblem.isPresent()) {
		return;
	}
	Optional<IBookmarkProblemHandler> handler = bookmarkProblems
			.getBookmarkProblemDescriptor(bookmarkProblem.get().getProblemType()).getBookmarkProblemHandler();
	if (!handler.isPresent()) {
		return;
	}
	try {
		handler.get().handleAction(bookmarkProblem.get());
	} catch (BookmarksException e) {
		ErrorDialog.openError(null, "Error", "Could not solve bookmark problem", e.getStatus());
	}
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:17,代码来源:BookmarkProblemsTooltip.java

示例11: createMessagesBundlePage

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * Creates a new text editor for the messages bundle, which gets added to a new page
 */
protected void createMessagesBundlePage(MessagesBundle messagesBundle) {
    try {
        IMessagesResource resource = messagesBundle.getResource();
        final TextEditor textEditor = (TextEditor) resource.getSource();
        int index = addPage(textEditor, textEditor.getEditorInput());
        setPageText(index,
                UIUtils.getDisplayName(messagesBundle.getLocale()));
        setPageImage(index, UIUtils.getImage(UIUtils.IMAGE_PROPERTIES_FILE));
        localesIndex.add(messagesBundle.getLocale());
        textEditorsIndex.add(textEditor);            
    } catch (PartInitException e) {
        ErrorDialog.openError(getSite().getShell(),
                "Error creating text editor page.", //$NON-NLS-1$
                null, e.getStatus());
    }
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:20,代码来源:AbstractMessagesEditor.java

示例12: showErrorDialog

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * Shows an error dialog based on the supplied arguments.
 * @param shell the shell
 * @param exception the core exception
 * @param msgKey key to the plugin message text
 */
public static void showErrorDialog(
        Shell shell, Exception exception, String msgKey) {
    exception.printStackTrace();
    IStatus status = new Status(
            IStatus.ERROR, 
            MessagesEditorPlugin.PLUGIN_ID,
            0, 
            MessagesEditorPlugin.getString(msgKey) + " " //$NON-NLS-1$
                    + MessagesEditorPlugin.getString("error.seeLogs"), //$NON-NLS-1$
            exception);
    ErrorDialog.openError(
            shell,
            MessagesEditorPlugin.getString(msgKey),
            exception.getLocalizedMessage(),
            status);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:23,代码来源:UIUtils.java

示例13: reportError

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * Opens an error dialog presenting the user with the specified message and
 * throwable
 * 
 * @param message
 * @param throwable
 */
protected static void reportError(String message, Throwable throwable) {
	IStatus status = null;
	if (throwable instanceof CoreException) {
		status = ((CoreException) throwable).getStatus();
	} else {
		status = new Status(IStatus.ERROR, JSBuildFileUIPlugin.PLUGIN_ID,
				0, message, throwable);
	}
	ErrorDialog
			.openError(
					JSBuildFileUIPlugin.getActiveWorkbenchWindow()
							.getShell(),
					JSBuildFileLaunchConfigurationMessages.AntLaunchShortcut_Error_7,
					JSBuildFileLaunchConfigurationMessages.AntLaunchShortcut_Build_Failed_2,
					status);
}
 
开发者ID:angelozerr,项目名称:jsbuild-eclipse,代码行数:24,代码来源:JSBuildFileLaunchShortcut.java

示例14: OpenEditor

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
private void OpenEditor(IFile file)
{
    if(file == null)
        return;
    try
    {
        IWorkbenchPage page = getWorkbenchPage();
        if(page != null)
            IDE.openEditor(page, file, true);
    }
    catch(CoreException e)
    {
        String title = Policy.bind("OpenEditorAction.errorTitle");
        String message = Policy.bind("OpenEditorAction.errorMessage");
        ErrorDialog.openError(getViewSite().getShell(), title, message, e.getStatus());
    }
  
}
 
开发者ID:qxo,项目名称:eclipse-code-lines-plugin,代码行数:19,代码来源:LinesView.java

示例15: statusDialog

import org.eclipse.jface.dialogs.ErrorDialog; //导入方法依赖的package包/类
/**
 * Creates a status dialog using the given {@code status} and {@code title}.
 *
 * @param title of the dialog
 * @param status to derive the severity
 */
public static void statusDialog(String title, IStatus status) {
  Shell shell = getActiveWorkbenchWindow().getShell();
  if (shell != null) {
    switch (status.getSeverity()) {
      case IStatus.ERROR:
        ErrorDialog.openError(shell, title, null, status);
        break;
      case IStatus.WARNING:
        MessageDialog.openWarning(shell, title, status.getMessage());
        break;
      case IStatus.INFO:
        MessageDialog.openInformation(shell, title, status.getMessage());
        break;
    }
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:23,代码来源:ChromiumDebugUIPlugin.java


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