-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #737 from eclipse-passage/572906
Bug 572906 improve DiagnosticDialog UX with colors
- Loading branch information
Showing
8 changed files
with
90 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
....jface/src/org/eclipse/passage/lic/internal/jface/dialogs/licensing/DiagnosticColors.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2021 ArSysOp | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* https://www.eclipse.org/legal/epl-2.0/. | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* ArSysOp - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.passage.lic.internal.jface.dialogs.licensing; | ||
|
||
import java.util.Arrays; | ||
|
||
import org.eclipse.swt.graphics.Color; | ||
|
||
final class DiagnosticColors { | ||
|
||
private final Color failure; | ||
private final Color error; | ||
private final Color warning; | ||
private final Color info; | ||
|
||
DiagnosticColors() { | ||
this.failure = new Color(222, 145, 145); | ||
this.error = new Color(233, 175, 215); | ||
this.warning = new Color(244, 228, 186); | ||
this.info = new Color(178, 201, 166); | ||
} | ||
|
||
Color get(boolean severe, boolean exception) { | ||
if (severe && exception) { | ||
return failure; | ||
} else if (severe && !exception) { | ||
return error; | ||
} else if (!severe && exception) { | ||
return warning; | ||
} else { | ||
return info; | ||
} | ||
} | ||
|
||
void dispose() { | ||
Arrays.asList(failure, error, warning, info)// | ||
.forEach(Color::dispose); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters