Search in sources :

Example 26 with ColorRegistry

use of org.eclipse.jface.resource.ColorRegistry in project dbeaver by dbeaver.

the class SQLScriptStatusDialog method endObjectProcessing.

@Override
public void endObjectProcessing(@NotNull T object, Exception error) {
    UIUtils.packColumns(objectTree, false, null);
    TreeItem treeItem = getTreeItem(object);
    if (treeItem != null) {
        treeItem.setText(1, error == null ? "Done" : error.getMessage());
        if (error != null) {
            ColorRegistry colorRegistry = UIUtils.getActiveWorkbenchWindow().getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
            Color colorError = colorRegistry.get(QueryLogViewer.COLOR_REVERTED);
            treeItem.setForeground(1, colorError);
        }
    }
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry) Color(org.eclipse.swt.graphics.Color)

Example 27 with ColorRegistry

use of org.eclipse.jface.resource.ColorRegistry in project dbeaver by serge-rider.

the class EntityFigure method setColors.

private void setColors() {
    ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
    if (entity.isPrimary()) {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_PRIMARY_BACKGROUND));
    } else if (entity.getObject().getEntityType() == DBSEntityType.ASSOCIATION) {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_ASSOCIATION_BACKGROUND));
    } else {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_REGULAR_BACKGROUND));
    }
    setForegroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_NAME_FOREGROUND));
    nameLabel.setForegroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_NAME_FOREGROUND));
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry)

Example 28 with ColorRegistry

use of org.eclipse.jface.resource.ColorRegistry in project dbeaver by serge-rider.

the class EntityFigure method add.

@Override
public void add(IFigure figure, Object constraint, int index) {
    if (figure instanceof AttributeItemFigure) {
        ColorRegistry colorRegistry = PlatformUI.getWorkbench().getThemeManager().getCurrentTheme().getColorRegistry();
        figure.setForegroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ATTR_FOREGROUND));
        figure.setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ATTR_BACKGROUND));
        if (((AttributeItemFigure) figure).getAttribute().isInPrimaryKey()) {
            keyFigure.add(figure, constraint, -1);
        } else {
            attributeFigure.add(figure, constraint, -1);
        }
    } else {
        super.add(figure, constraint, index);
    }
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry)

Example 29 with ColorRegistry

use of org.eclipse.jface.resource.ColorRegistry in project tdi-studio-se by Talend.

the class JSONToXPathLinker method initColors.

/**
     * DOC amaumont Comment method "initColors".
     * 
     * @param display
     */
private void initColors(Display display) {
    RGB selectedLoopLinkRGB = new RGB(255, 131, 0);
    RGB selectedRelativeLinkRGB = new RGB(110, 168, 255);
    ColorRegistry colorRegistry = JFaceResources.getColorRegistry();
    if (colorRegistry.get(selectedLoopLinkRGB.toString()) == null) {
        colorRegistry.put(selectedLoopLinkRGB.toString(), selectedLoopLinkRGB);
    }
    if (colorRegistry.get(selectedRelativeLinkRGB.toString()) == null) {
        colorRegistry.put(selectedRelativeLinkRGB.toString(), selectedRelativeLinkRGB);
    }
    selectedLoopLinkColor = colorRegistry.get(selectedLoopLinkRGB.toString());
    selectedRelativeLinkColor = colorRegistry.get(selectedRelativeLinkRGB.toString());
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry) RGB(org.eclipse.swt.graphics.RGB)

Example 30 with ColorRegistry

use of org.eclipse.jface.resource.ColorRegistry in project dbeaver by dbeaver.

the class EntityFigure method setColors.

private void setColors() {
    ColorRegistry colorRegistry = UIUtils.getColorRegistry();
    if (entity.isPrimary()) {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_PRIMARY_BACKGROUND));
    } else if (entity.getObject().getEntityType() == DBSEntityType.ASSOCIATION) {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_ASSOCIATION_BACKGROUND));
    } else {
        setBackgroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_REGULAR_BACKGROUND));
    }
    setForegroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_NAME_FOREGROUND));
    nameLabel.setForegroundColor(colorRegistry.get(ERDConstants.COLOR_ERD_ENTITY_NAME_FOREGROUND));
}
Also used : ColorRegistry(org.eclipse.jface.resource.ColorRegistry)

Aggregations

ColorRegistry (org.eclipse.jface.resource.ColorRegistry)48 Color (org.eclipse.swt.graphics.Color)14 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)8 RGB (org.eclipse.swt.graphics.RGB)6 TextAttribute (org.eclipse.jface.text.TextAttribute)5 GridData (org.eclipse.swt.layout.GridData)4 GridLayout (org.eclipse.swt.layout.GridLayout)4 java.awt (java.awt)2 ArrayList (java.util.ArrayList)2 LinkedList (java.util.LinkedList)2 IPresentationReconciler (org.eclipse.jface.text.presentation.IPresentationReconciler)2 PresentationReconciler (org.eclipse.jface.text.presentation.PresentationReconciler)2 DefaultDamagerRepairer (org.eclipse.jface.text.rules.DefaultDamagerRepairer)2 ControlEvent (org.eclipse.swt.events.ControlEvent)2 Display (org.eclipse.swt.widgets.Display)2 Label (org.eclipse.swt.widgets.Label)2 Text (org.eclipse.swt.widgets.Text)2 ITheme (org.eclipse.ui.themes.ITheme)2 PlotterListener (io.sloeber.ui.monitor.internal.PlotterListener)1 CoreException (org.eclipse.core.runtime.CoreException)1