use of org.openide.NotificationLineSupport in project gephi by gephi.
the class TopDialog method updateMessage.
public void updateMessage() {
if (messageComponent != null) {
getContentPane().remove(messageComponent);
}
//System.err.println("updateMessage: " + nd.getMessage());
messageComponent = message2Component(nd.getMessage());
if (!(nd instanceof WizardDescriptor) && nd.getNotificationLineSupport() != null) {
JComponent toAdd = new JPanel(new BorderLayout());
toAdd.add(messageComponent, BorderLayout.CENTER);
//NOI18N
nbErrorForeground = UIManager.getColor("nb.errorForeground");
if (nbErrorForeground == null) {
//nbErrorForeground = new Color(89, 79, 191); // RGB suggested by Bruce in #28466
// RGB suggested by jdinga in #65358
nbErrorForeground = new Color(255, 0, 0);
}
//NOI18N
nbWarningForeground = UIManager.getColor("nb.warningForeground");
if (nbWarningForeground == null) {
// Label.foreground
nbWarningForeground = new Color(51, 51, 51);
}
//NOI18N
nbInfoForeground = UIManager.getColor("nb.warningForeground");
if (nbInfoForeground == null) {
//NOI18N
nbInfoForeground = UIManager.getColor("Label.foreground");
}
notificationLine = new FixedHeightLabel();
NotificationLineSupport nls = nd.getNotificationLineSupport();
if (nls.getInformationMessage() != null) {
updateNotificationLine(this, MSG_TYPE_INFO, nls.getInformationMessage());
} else if (nls.getWarningMessage() != null) {
updateNotificationLine(this, MSG_TYPE_WARNING, nls.getWarningMessage());
} else if (nls.getErrorMessage() != null) {
updateNotificationLine(this, MSG_TYPE_ERROR, nls.getErrorMessage());
}
toAdd.add(notificationLine, BorderLayout.SOUTH);
messageComponent = toAdd;
}
getContentPane().add(messageComponent, BorderLayout.CENTER);
}
Aggregations