Search in sources :

Example 1 with GUIResource

use of org.pentaho.di.ui.core.gui.GUIResource in project pdi-dataservice-server-plugin by pentaho.

the class DataServiceViewTreeExtension method refreshTree.

protected void refreshTree(SelectionTreeExtension selectionTreeExtension) {
    TransMeta meta = (TransMeta) selectionTreeExtension.getMeta();
    TreeItem tiRootName = selectionTreeExtension.getTiRootName();
    GUIResource guiResource = selectionTreeExtension.getGuiResource();
    TreeItem tiDSTitle = createTreeItem(tiRootName, STRING_DATA_SERVICES, guiResource.getImageFolder());
    for (DataServiceMeta dataService : delegate.getDataServices(meta)) {
        createTreeItem(tiDSTitle, dataService.getName(), getDataServiceImage(guiResource, dataService));
    }
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) TreeItem(org.eclipse.swt.widgets.TreeItem) DataServiceMeta(org.pentaho.di.trans.dataservice.DataServiceMeta) TransMeta(org.pentaho.di.trans.TransMeta)

Example 2 with GUIResource

use of org.pentaho.di.ui.core.gui.GUIResource in project pentaho-kettle by pentaho.

the class PropsUI method setLook.

public void setLook(final Control control, int style) {
    if (this.isOSLookShown() && style != WIDGET_STYLE_FIXED) {
        return;
    }
    final GUIResource gui = GUIResource.getInstance();
    Font font = null;
    Color background = null;
    switch(style) {
        case WIDGET_STYLE_DEFAULT:
            background = gui.getColorBackground();
            if (control instanceof Group && OS.indexOf("mac") > -1) {
                control.addPaintListener(new PaintListener() {

                    @Override
                    public void paintControl(PaintEvent paintEvent) {
                        paintEvent.gc.setBackground(gui.getColorBackground());
                        paintEvent.gc.fillRectangle(2, 0, control.getBounds().width - 8, control.getBounds().height - 20);
                    }
                });
            }
            // GUIResource.getInstance().getFontDefault();
            font = null;
            break;
        case WIDGET_STYLE_FIXED:
            if (!this.isOSLookShown()) {
                background = gui.getColorBackground();
            }
            font = gui.getFontFixed();
            break;
        case WIDGET_STYLE_TABLE:
            background = gui.getColorBackground();
            // gui.getFontGrid();
            font = null;
            break;
        case WIDGET_STYLE_NOTEPAD:
            background = gui.getColorBackground();
            font = gui.getFontNote();
            break;
        case WIDGET_STYLE_GRAPH:
            background = gui.getColorBackground();
            font = gui.getFontGraph();
            break;
        case WIDGET_STYLE_TOOLBAR:
            background = GUIResource.getInstance().getColorDemoGray();
            break;
        case WIDGET_STYLE_TAB:
            background = GUIResource.getInstance().getColorWhite();
            CTabFolder tabFolder = (CTabFolder) control;
            tabFolder.setSimple(false);
            tabFolder.setBorderVisible(true);
            // need to make a copy of the tab selection background color to get around PDI-13940
            Color c = GUIResource.getInstance().getColorTab();
            Color tabColor = new Color(c.getDevice(), c.getRed(), c.getGreen(), c.getBlue());
            tabFolder.setSelectionBackground(tabColor);
            break;
        default:
            background = gui.getColorBackground();
            // gui.getFontDefault();
            font = null;
            break;
    }
    if (font != null && !font.isDisposed()) {
        control.setFont(font);
    }
    if (background != null && !background.isDisposed()) {
        if (control instanceof Button) {
            Button b = (Button) control;
            if ((b.getStyle() & SWT.PUSH) != 0) {
                return;
            }
        }
        control.setBackground(background);
    }
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) Group(org.eclipse.swt.widgets.Group) PaintEvent(org.eclipse.swt.events.PaintEvent) CTabFolder(org.eclipse.swt.custom.CTabFolder) PaintListener(org.eclipse.swt.events.PaintListener) Button(org.eclipse.swt.widgets.Button) Color(org.eclipse.swt.graphics.Color) Font(org.eclipse.swt.graphics.Font)

Example 3 with GUIResource

use of org.pentaho.di.ui.core.gui.GUIResource in project pentaho-kettle by pentaho.

the class SpoonRefreshClustersSubtreeTest method setUp.

@Before
public void setUp() throws Exception {
    GUIResource guiResource = mock(GUIResource.class);
    clustersFolderProvider = new ClustersFolderProvider(guiResource);
    treeNode = new TreeNode();
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) ClustersFolderProvider(org.pentaho.di.ui.spoon.tree.provider.ClustersFolderProvider) TreeNode(org.pentaho.di.ui.core.widget.tree.TreeNode) Before(org.junit.Before)

Example 4 with GUIResource

use of org.pentaho.di.ui.core.gui.GUIResource in project pentaho-kettle by pentaho.

the class SpoonRefreshHopsSubtreeTest method setUp.

@Before
public void setUp() throws Exception {
    GUIResource guiResource = mock(GUIResource.class);
    hopsFolderProvider = new HopsFolderProvider(guiResource);
    treeNode = new TreeNode();
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) TreeNode(org.pentaho.di.ui.core.widget.tree.TreeNode) HopsFolderProvider(org.pentaho.di.ui.spoon.tree.provider.HopsFolderProvider) Before(org.junit.Before)

Example 5 with GUIResource

use of org.pentaho.di.ui.core.gui.GUIResource in project pentaho-kettle by pentaho.

the class SpoonRefreshSlavesSubtreeTest method setUp.

@Before
public void setUp() throws Exception {
    GUIResource guiResource = mock(GUIResource.class);
    slavesFolderProvider = new SlavesFolderProvider(guiResource);
    treeNode = new TreeNode();
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) SlavesFolderProvider(org.pentaho.di.ui.spoon.tree.provider.SlavesFolderProvider) TreeNode(org.pentaho.di.ui.core.widget.tree.TreeNode) Before(org.junit.Before)

Aggregations

GUIResource (org.pentaho.di.ui.core.gui.GUIResource)10 TreeNode (org.pentaho.di.ui.core.widget.tree.TreeNode)6 Before (org.junit.Before)5 TreeItem (org.eclipse.swt.widgets.TreeItem)2 RunConfiguration (org.pentaho.di.engine.configuration.api.RunConfiguration)2 CTabFolder (org.eclipse.swt.custom.CTabFolder)1 PaintEvent (org.eclipse.swt.events.PaintEvent)1 PaintListener (org.eclipse.swt.events.PaintListener)1 Color (org.eclipse.swt.graphics.Color)1 Font (org.eclipse.swt.graphics.Font)1 Image (org.eclipse.swt.graphics.Image)1 Button (org.eclipse.swt.widgets.Button)1 Group (org.eclipse.swt.widgets.Group)1 TableItem (org.eclipse.swt.widgets.TableItem)1 TransMeta (org.pentaho.di.trans.TransMeta)1 DataServiceMeta (org.pentaho.di.trans.dataservice.DataServiceMeta)1 StepDebugMeta (org.pentaho.di.trans.debug.StepDebugMeta)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 ClustersFolderProvider (org.pentaho.di.ui.spoon.tree.provider.ClustersFolderProvider)1 DBConnectionFolderProvider (org.pentaho.di.ui.spoon.tree.provider.DBConnectionFolderProvider)1