本文整理汇总了Java中org.eclipse.jface.dialogs.IMessageProvider.ERROR属性的典型用法代码示例。如果您正苦于以下问题:Java IMessageProvider.ERROR属性的具体用法?Java IMessageProvider.ERROR怎么用?Java IMessageProvider.ERROR使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.jface.dialogs.IMessageProvider
的用法示例。
在下文中一共展示了IMessageProvider.ERROR属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: create
@Override
public void create() {
super.create();
String title;
String message;
int type;
if (anomalyCausingConstraints == null) {
title = getTitleNoAnomaly();
message = getMessageNoAnomaly();
type = IMessageProvider.INFORMATION;
} else {
title = getTitleAnomalyExplanation();
message = getMessageAnomalyExplanation();
type = IMessageProvider.ERROR;
}
setTitle(title);
setMessage(message, type);
}
示例2: create
@Override
public void create() {
super.create();
String title;
String message;
int type;
if (invalidContextValues == null && invalidDate == null) {
title = TITLE_NO_INVALID_CONTEXT;
message = MESSAGE_NO_INVALID_CONTEXT;
type = IMessageProvider.INFORMATION;
} else {
title = TITLE_INVALID_CONTEXT;
message = MESSAGE_INVALID_CONTEXT;
type = IMessageProvider.ERROR;
}
setTitle(title);
setMessage(message, type);
}
示例3: 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;
}
}
示例4: 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);
}
示例5: 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 );
}
}
示例6: 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();
}
}
示例7: getErrorMessageCount
/**
* @return Returns the number of error messages
*/
@SuppressWarnings("unchecked")
public int getErrorMessageCount() {
int errors = 0;
for (final Enumeration<ControlDecorator> enm = decorators.elements(); enm.hasMoreElements();) {
final ControlDecorator dec = enm.nextElement();
final ArrayList<?> allMessages = dec.controlMessages;
for (final Object object : allMessages) {
if (object instanceof Message) {
final Message message = (Message) object;
if (message.getMessageType() == IMessageProvider.ERROR) {
errors++;
}
}
}
}
return errors;
}
示例8: updateMessage
public void updateMessage( )
{
PropertyPage propertyPage = getCurrentPropertyPage( );
if ( propertyPage != null )
{
String message = propertyPage.getMessage( );
int messageType = propertyPage.getMessageType( );
// if error message exists, it takes precedence over page's non-error message
if ( messageType < IMessageProvider.ERROR )
{
String errMessage = propertyPage.getErrorMessage();
if ( errMessage != null )
{
message = errMessage;
messageType = IMessageProvider.ERROR;
}
}
setMessage( message, messageType );
}
}
示例9: setMessage
public final void setMessage( String message, int messageType )
{
if ( messageArea != null )
{
if ( messageType != IMessageProvider.NONE )
{
titleImage.setVisible( false );
}
else
{
titleImage.setVisible( true );
}
if ( message == null && messageType == IMessageProvider.ERROR )
{
messageArea.updateText( "", messageType );
}
else
{
messageArea.updateText( message, messageType );
}
}
}
示例10: 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 );
}
示例11: 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;
}
示例12: 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());
}
示例13: 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;
}
示例14: setMessage
@Override
public void setMessage(String newMessage, int newType) {
if (newType == IMessageProvider.ERROR) {
withError = true;
} else {
withError = false;
}
super.setMessage(newMessage, newType);
}
示例15: 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;
}
}