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


Java IMessageProvider.WARNING属性代码示例

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


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

示例1: getStatus

@Override
public IStatus getStatus() {
  // DialogPage has an unfortunately complex set of message possibilities
  String message = messages.getErrorMessage();
  if (message != null) {
    return new Status(IStatus.ERROR, PLUGIN_ID, message);
  }
  int messageType = messages.getMessageType();
  switch (messageType) {
    case IMessageProvider.INFORMATION:
      return new Status(IStatus.INFO, PLUGIN_ID, messages.getMessage());
    case IMessageProvider.WARNING:
      return new Status(IStatus.WARNING, PLUGIN_ID, messages.getMessage());
    case IMessageProvider.ERROR:
      return new Status(IStatus.ERROR, PLUGIN_ID, messages.getMessage());
    default:
      return Status.OK_STATUS;
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:19,代码来源:FieldEditorWrapper.java

示例2: create

@Override
public void create() {
    super.create();
    setTitle("Event Details");

    String titleMessage = "";
    titleMessage += "\tGeneration Time:\t" + TimeEncoding.toString(event.getGenerationTime()) + "\n";
    titleMessage += "\tReception Time:\t" + TimeEncoding.toString(event.getReceptionTime());
    int icon = IMessageProvider.NONE;
    if (event.getSeverity() == EventSeverity.ERROR)
        icon = IMessageProvider.ERROR;
    else if (event.getSeverity() == EventSeverity.WARNING)
        icon = IMessageProvider.WARNING;
    else if (event.getSeverity() == EventSeverity.INFO)
        icon = IMessageProvider.INFORMATION;
    setMessage(titleMessage, icon);
}
 
开发者ID:yamcs,项目名称:yamcs-studio,代码行数:17,代码来源:EventDetailsDialog.java

示例3: updateStatusMessage

@SuppressWarnings("incomplete-switch")
private void updateStatusMessage( ValidationStatus validationStatus ) {
  if( visible ) {
    int messageType = IMessageProvider.NONE;
    String message = null;
    switch( validationStatus.getSeverity() ) {
      case ERROR:
        messageType = IMessageProvider.ERROR;
        message = validationStatus.getMessage();
        break;
      case WARNING:
        messageType = IMessageProvider.WARNING;
        message = validationStatus.getMessage();
        break;
    }
    setMessage( message, messageType );
    setPageComplete( validationStatus.getSeverity() != Severity.ERROR );
  }
}
 
开发者ID:rherrmann,项目名称:eclipse-extras,代码行数:19,代码来源:DynamicWorkingSetPage.java

示例4: update

public void update() {
	if (controlMessages.isEmpty()) {
		decoration.setDescriptionText(null);
		decoration.hide();
	} else {
		final ArrayList peers = createPeers(controlMessages);
		final int type = ((IMessage) peers.get(0)).getMessageType();
		final String description = createDetails(createPeers(peers), true);
		if (type == IMessageProvider.ERROR)
			decoration.setImage(standardError.getImage());
		else if (type == IMessageProvider.WARNING)
			decoration.setImage(standardWarning.getImage());
		else if (type == IMessageProvider.INFORMATION)
			decoration.setImage(standardInformation.getImage());
		decoration.setDescriptionText(description);
		decoration.show();
	}
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:18,代码来源:MessageManager.java

示例5: updateMessage

public void updateMessage() {
	if (commitButton == null)
		// Not yet fully initialized.
		return;

	String message = null;
	int type = IMessageProvider.NONE;

	String commitMsg = getEditor().getText().getText().toString();
	if (commitMsg == null || commitMsg.trim().length() == 0) {
		message = Messages.FilesChangedListDialog_EmptyMessage;
		type = IMessageProvider.INFORMATION;
	} else if (!isCommitWithoutFilesAllowed()) {
		message = Messages.FilesChangedListDialog_EmptySelection;
		type = IMessageProvider.INFORMATION;
	}

	setMessage(message, type);
	boolean commitEnabled = type == IMessageProvider.WARNING
			|| type == IMessageProvider.NONE;
	commitButton.setEnabled(commitEnabled);
	commitAndPushButton.setEnabled(commitEnabled);
}
 
开发者ID:SEMERU-WM,项目名称:ChangeScribe,代码行数:23,代码来源:FilesChangedListDialog.java

示例6: setTitleMessage

public void setTitleMessage( String newMessage, int newType )
{
	Image newImage = null;
	if ( newMessage != null )
	{
		switch ( newType )
		{
			case IMessageProvider.NONE :
				break;
			case IMessageProvider.INFORMATION :
				newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_INFO );
				break;
			case IMessageProvider.WARNING :
				newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_WARNING );
				break;
			case IMessageProvider.ERROR :
				newImage = JFaceResources.getImage( DLG_IMG_MESSAGE_ERROR );
				break;
		}
	}
	showTitleMessage( newMessage, newImage );
}
 
开发者ID:eclipse,项目名称:birt,代码行数:22,代码来源:StyleBuilder.java

示例7: update

@Override
protected void update(final IValidity validity) {
    if (!firstTime && validity != null && validity.getSeverity() != Severity.OK) {
        final IValidationMessage message = validity.getFirstMessage();
        if (message != null && message.getMessage() != null) {
            final int type =
                message.getSeverity() == Severity.WARNING ? IMessageProvider.WARNING : IMessageProvider.ERROR;
            dialogPage.setMessage(message.getMessage(), type);
            return;
        }
    }

    dialogPage.setMessage(null);
    return;
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:15,代码来源:DialogPageValidatorBinding.java

示例8: updateFormBookmarkProblems

private void updateFormBookmarkProblems(Bookmark bookmark) {
	if (bookmark == null) {
		form.setMessage(null);
		return;
	}
	// We do not consider bookmark problems with severity info
	Set<BookmarkProblem> problems = bookmarkProblems.getBookmarkProblems(bookmark.getId()).stream()
			.filter(bookmarkProblem -> getBookmarkProblemSeverity(bookmarkProblem) != Severity.INFO)
			.collect(Collectors.toSet());
	if (problems.size() == 0) {
		form.setMessage(null);
		return;
	}
	BookmarkProblem firstProblem = problems.iterator().next();
	int type = getBookmarkProblemSeverity(firstProblem) == Severity.ERROR ? IMessageProvider.ERROR
			: IMessageProvider.WARNING;
	form.setMessage(problems.size() == 1 ? "One bookmark problem detected"
			: "" + problems.size() + " bookmark problems detected", type);
	if (bookmarkProblemsTooltip == null) {
		Control control = Stream.of(form.getHead().getChildren()).filter(child -> child instanceof CLabel)
				.findFirst().get();
		// bug in form ? Without this line, background for the message is
		// sometimes gray
		control.setBackground(getSite().getShell().getDisplay().getSystemColor(SWT.COLOR_TRANSPARENT));
		bookmarkProblemsTooltip = new BookmarkProblemsTooltip(toolkit, control, ToolTip.NO_RECREATE,
				bookmarkProblems) {
			public Point getLocation(Point tipSize, Event event) {
				Rectangle bounds = control.getBounds();
				return control.getParent().toDisplay(bounds.x, bounds.y);
			}
		};
		bookmarkProblemsTooltip.setHideOnMouseDown(false);
	}
	bookmarkProblemsTooltip.setBookmark(bookmark.getId());
}
 
开发者ID:cchabanois,项目名称:mesfavoris,代码行数:35,代码来源:BookmarksView.java

示例9: getMessageProviderType

public static int getMessageProviderType(IStatus status) {
	if (status == null) {
		return IMessageProvider.NONE;
	}

	switch (status.getSeverity()) {
	case IStatus.INFO:
		return IMessageProvider.INFORMATION;
	case IStatus.WARNING:
		return IMessageProvider.WARNING;
	case IStatus.ERROR:
		return IMessageProvider.ERROR;
	}
	return IMessageProvider.NONE;
}
 
开发者ID:eclipse,项目名称:cft,代码行数:15,代码来源:EditorMessageTypes.java

示例10: setMessageInPage

protected void setMessageInPage(IStatus status) {
	String message = status.getMessage();
	int providerStatus = IMessageProvider.NONE;
	switch (status.getSeverity()) {
	case IStatus.INFO:
		providerStatus = IMessageProvider.INFORMATION;
		break;
	case IStatus.WARNING:
		providerStatus = IMessageProvider.WARNING;
		break;
	}

	editorPage.setMessage(message, providerStatus);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:14,代码来源:EditorAction.java

示例11: setMessageInPage

protected void setMessageInPage(IStatus status) {
	String message = status.getMessage();
	int providerStatus = IMessageProvider.NONE;
	switch (status.getSeverity()) {
	case IStatus.INFO:
		providerStatus = IMessageProvider.INFORMATION;
		break;
	case IStatus.WARNING:
		providerStatus = IMessageProvider.WARNING;
		break;
	}

	setMessage(message, providerStatus);
}
 
开发者ID:osswangxining,项目名称:dockerfoundry,代码行数:14,代码来源:DockerFoundryApplicationsEditorPage.java

示例12: convertSeverity

/**
 * Converts a standard IStatus's severity into the severity flags used by
 * dialogs and property pages.
 */
protected static int convertSeverity(IStatus status) {
  switch (status.getSeverity()) {
    case IStatus.ERROR:
      return IMessageProvider.ERROR;
    case IStatus.WARNING:
      return IMessageProvider.WARNING;
    case IStatus.INFO:
      return IMessageProvider.INFORMATION;
    default:
      return IMessageProvider.NONE;
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:16,代码来源:AbstractProjectPropertyPage.java

示例13: convertSeverity

private static int convertSeverity(IStatus status) {
  switch (status.getSeverity()) {
    case IStatus.ERROR:
      return IMessageProvider.ERROR;
    case IStatus.WARNING:
      return IMessageProvider.WARNING;
    case IStatus.INFO:
      return IMessageProvider.INFORMATION;
    default:
      return IMessageProvider.NONE;
  }
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:12,代码来源:AbstractTitleAreaDialog.java

示例14: updateText

/**
 * Show the new message in the message text and update the image. Base the background color on
 * whether or not there are errors.
 * 
 * @param newMessage
 *            The new value for the message
 * @param newType
 *            One of the IMessageProvider constants. If newType is IMessageProvider.NONE show
 *            the title.
 * @see IMessageProvider
 */
public void updateText(final String newMessage, final int newType) {
	Image newImage = null;
	boolean showingError = false;
	switch (newType) {
	case IMessageProvider.NONE:
		hideRegion();
		return;
	case IMessageProvider.INFORMATION:
		newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_INFO);
		break;
	case IMessageProvider.WARNING:
		newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_WARNING);
		break;
	case IMessageProvider.ERROR:
		newImage = JFaceResources.getImage(Dialog.DLG_IMG_MESSAGE_ERROR);
		showingError = true;
		break;
	}

	if (newMessage == null) {//No message so clear the area
		hideRegion();
		return;
	}
	showRegion();
	// Any more updates required
	if (newMessage.equals(messageText.getText()) && newImage == messageImageLabel.getImage()) {
		return;
	}
	messageImageLabel.setImage(newImage);
	messageText.setText(newMessage);
	if (showingError) {
		setMessageColors(JFaceColors.getErrorBackground(messageComposite.getDisplay()));
	} else {
		lastMessageText = newMessage;
		setMessageColors(JFaceColors.getBannerBackground(messageComposite.getDisplay()));
	}

}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:49,代码来源:MessageRegion.java

示例15: getImage

private Image getImage(int type) {
    switch (type) {
    case IMessageProvider.ERROR:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_ERROR_TSK);
    case IMessageProvider.WARNING:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_WARN_TSK);
    case IMessageProvider.INFORMATION:
        return PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_OBJS_INFO_TSK);
    }
    return null;
}
 
开发者ID:apache,项目名称:ant-ivyde,代码行数:11,代码来源:ResolveVisualizerForm.java


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