Search in sources :

Example 6 with GUIResource

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

the class TransDebugDialog method refreshStepList.

private void refreshStepList() {
    GUIResource resource = GUIResource.getInstance();
    // Add the list of steps...
    // 
    int maxIconSize = 0;
    int indexSelected = -1;
    wSteps.table.removeAll();
    for (int i = 0; i < transDebugMeta.getTransMeta().getSteps().size(); i++) {
        StepMeta stepMeta = transDebugMeta.getTransMeta().getStep(i);
        TableItem item = new TableItem(wSteps.table, SWT.NONE);
        Image image = resource.getImagesSteps().get(stepMeta.getStepID()).getAsBitmapForSize(display, ConstUI.ICON_SIZE, ConstUI.ICON_SIZE);
        item.setImage(0, image);
        item.setText(0, "");
        item.setText(1, stepMeta.getName());
        if (image.getBounds().width > maxIconSize) {
            maxIconSize = image.getBounds().width;
        }
        StepDebugMeta stepDebugMeta = stepDebugMetaMap.get(stepMeta);
        if (stepDebugMeta != null) {
            // We have debugging information so we mark the row
            // 
            item.setBackground(resource.getColorLightPentaho());
            if (indexSelected < 0) {
                indexSelected = i;
            }
        }
    }
    wSteps.removeEmptyRows();
    wSteps.optWidth(false);
    wSteps.table.getColumn(0).setWidth(maxIconSize + 10);
    wSteps.table.getColumn(0).setAlignment(SWT.CENTER);
    // 
    if (indexSelected >= 0) {
        wSteps.table.setSelection(indexSelected);
        showStepDebugInformation();
    }
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) TableItem(org.eclipse.swt.widgets.TableItem) Image(org.eclipse.swt.graphics.Image) StepMeta(org.pentaho.di.trans.step.StepMeta) StepDebugMeta(org.pentaho.di.trans.debug.StepDebugMeta)

Example 7 with GUIResource

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

the class SpoonRefreshDbConnectionsSubtreeTest method setUp.

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

Example 8 with GUIResource

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

the class SpoonRefreshPartitionsSubtreeTest method setUp.

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

Example 9 with GUIResource

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

the class RunConfigurationFolderProvider method refresh.

@Override
public void refresh(AbstractMeta meta, TreeNode treeNode, String filter) {
    GUIResource guiResource = GUIResource.getInstance();
    for (RunConfiguration runConfiguration : runConfigurationDelegate.load()) {
        if (!filterMatch(runConfiguration.getName(), filter)) {
            continue;
        }
        String imageFile = runConfiguration.isReadOnly() ? "images/run_tree_disabled.svg" : "images/run_tree.svg";
        TreeNode childTreeNode = createChildTreeNode(treeNode, runConfiguration.getName(), getRunConfigurationImage(guiResource, imageFile));
        if (runConfiguration.isReadOnly()) {
            childTreeNode.setForeground(getDisabledColor());
        }
    }
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) RunConfiguration(org.pentaho.di.engine.configuration.api.RunConfiguration) TreeNode(org.pentaho.di.ui.core.widget.tree.TreeNode)

Example 10 with GUIResource

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

the class RunConfigurationViewTreeExtension method refreshTree.

private void refreshTree(SelectionTreeExtension selectionTreeExtension) {
    TreeItem tiRootName = selectionTreeExtension.getTiRootName();
    GUIResource guiResource = selectionTreeExtension.getGuiResource();
    TreeItem tiEETitle = createTreeItem(tiRootName, TREE_LABEL, guiResource.getImageFolder(), 0);
    for (RunConfiguration runConfiguration : runConfigurationDelegate.load()) {
        String imageFile = runConfiguration.isReadOnly() ? "images/run_tree_disabled.svg" : "images/run_tree.svg";
        createTreeItem(tiEETitle, runConfiguration.getName(), getRunConfigurationImage(guiResource, imageFile), -1, runConfiguration.isReadOnly());
    }
}
Also used : GUIResource(org.pentaho.di.ui.core.gui.GUIResource) RunConfiguration(org.pentaho.di.engine.configuration.api.RunConfiguration) TreeItem(org.eclipse.swt.widgets.TreeItem)

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