Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 413921
Collapse All | Expand All

(-)a/org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/provider/labelprovider/GeneralLabelProvider.java (-7 / +29 lines)
Lines 102-114 public class GeneralLabelProvider extends ColumnLabelProvider Link Here
102
    
102
    
103
    /** The color for disabled elements */
103
    /** The color for disabled elements */
104
    private static final Color DISABLED_COLOR = LayoutUtil.GRAY_COLOR;
104
    private static final Color DISABLED_COLOR = LayoutUtil.GRAY_COLOR;
105
    
105
    /** The color for reusedProjects */
106
    /** The color for reusedProjects */
106
    private static final Color REUSED_PROJECTS_COLOR = Display.getDefault()
107
    private static Color reusedProjectsColor = null;
107
            .getSystemColor(SWT.COLOR_BLUE);
108
    
108
    
109
    /** clipboard */
109
    /** clipboard */
110
    private static Clipboard clipboard = new Clipboard(PlatformUI
110
    private static Clipboard clipboard = null;
111
            .getWorkbench().getActiveWorkbenchWindow().getShell().getDisplay());
112
111
113
    /** {@inheritDoc} */
112
    /** {@inheritDoc} */
114
    public void dispose() {
113
    public void dispose() {
Lines 131-137 public class GeneralLabelProvider extends ColumnLabelProvider Link Here
131
        }
130
        }
132
        
131
        
133
        // elements that have been "cut" to the clipboard should be grayscale
132
        // elements that have been "cut" to the clipboard should be grayscale
134
        Object cbContents = clipboard.getContents(
133
        Object cbContents = getClipboard().getContents(
135
                LocalSelectionClipboardTransfer.getInstance());
134
                LocalSelectionClipboardTransfer.getInstance());
136
        if (cbContents instanceof IStructuredSelection) {
135
        if (cbContents instanceof IStructuredSelection) {
137
            IStructuredSelection sel = (IStructuredSelection)cbContents;
136
            IStructuredSelection sel = (IStructuredSelection)cbContents;
Lines 144-149 public class GeneralLabelProvider extends ColumnLabelProvider Link Here
144
    }
143
    }
145
    
144
    
146
    /**
145
    /**
146
     * returns the clipboard after creating it if necessary
147
     * @return the clipboard
148
     */
149
    private Clipboard getClipboard() {
150
        if (clipboard == null) {
151
            clipboard = new Clipboard(PlatformUI.getWorkbench()
152
                    .getActiveWorkbenchWindow().getShell().getDisplay());
153
        }
154
        return clipboard;
155
    }
156
157
    /**
147
     * {@inheritDoc}
158
     * {@inheritDoc}
148
     */
159
     */
149
    public String getToolTipText(Object element) {
160
    public String getToolTipText(Object element) {
Lines 332-344 public class GeneralLabelProvider extends ColumnLabelProvider Link Here
332
        if (element instanceof IReusedProjectPO
343
        if (element instanceof IReusedProjectPO
333
                || (element instanceof INodePO 
344
                || (element instanceof INodePO 
334
                && !NodeBP.isEditable((INodePO)element))) {
345
                && !NodeBP.isEditable((INodePO)element))) {
335
            return REUSED_PROJECTS_COLOR;
346
            return getReusedProjectsColor();
336
        }
347
        }
337
348
338
        return null;
349
        return null;
339
    }
350
    }
340
    
351
    
341
    /**
352
    /**
353
     * returns the color of a reused project after creating it if necessary
354
     * @return the color of a reused project
355
     */
356
    private Color getReusedProjectsColor() {
357
        if (reusedProjectsColor == null) {
358
            reusedProjectsColor = Display.getDefault()
359
                    .getSystemColor(SWT.COLOR_BLUE);
360
        }
361
        return reusedProjectsColor;
362
    }
363
364
    /**
342
     * 
365
     * 
343
     * @param testStep The Test Step to examine.
366
     * @param testStep The Test Step to examine.
344
     * @return label text for the given Test Step.
367
     * @return label text for the given Test Step.
345
- 

Return to bug 413921