Search in sources :

Example 1 with ITreeContentProvider

use of org.eclipse.jface.viewers.ITreeContentProvider in project tdi-studio-se by Talend.

the class JobScriptsExportWizardPage method collectNodes.

private void collectNodes(Map<String, Item> items, RepositoryNode repositoryNode) {
    IRepositoryViewObject repositoryObject = repositoryNode.getObject();
    if (repositoryObject != null) {
        if (repositoryObject.getRepositoryObjectType().isResourceItem()) {
            Item item = repositoryObject.getProperty().getItem();
            items.put(item.getProperty().getId(), item);
        }
    } else {
        if (repositoryNode.getParent() != null && repositoryNode.getParent().getObject() != null) {
            Item item = repositoryNode.getParent().getObject().getProperty().getItem();
            items.put(item.getProperty().getId(), item);
        }
    }
    if (this.treeViewer != null) {
        IContentProvider contentProvider = this.treeViewer.getFilteredCheckboxTree().getViewer().getContentProvider();
        if (contentProvider instanceof ITreeContentProvider) {
            Object[] children = ((ITreeContentProvider) contentProvider).getChildren(repositoryNode);
            collectNodes(items, children);
        }
    }
}
Also used : Item(org.talend.core.model.properties.Item) FolderItem(org.talend.core.model.properties.FolderItem) TableItem(org.eclipse.swt.widgets.TableItem) ProcessItem(org.talend.core.model.properties.ProcessItem) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) IContentProvider(org.eclipse.jface.viewers.IContentProvider) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject)

Example 2 with ITreeContentProvider

use of org.eclipse.jface.viewers.ITreeContentProvider in project tdi-studio-se by Talend.

the class DB2ExplainPlanExecution method displayResults.

private void displayResults(final ExplainNode node) {
    Display.getDefault().asyncExec(new Runnable() {

        @Override
        @SuppressWarnings("deprecation")
        public void run() {
            clearCanvas();
            GridLayout gLayout = new GridLayout();
            gLayout.numColumns = 2;
            gLayout.marginLeft = 0;
            gLayout.horizontalSpacing = 0;
            gLayout.verticalSpacing = 0;
            gLayout.marginWidth = 0;
            gLayout.marginHeight = 0;
            composite.setLayout(gLayout);
            try {
                //$NON-NLS-1$
                composite.setData("parenttab", parentTab);
                Composite pp = new Composite(composite, SWT.NULL);
                pp.setLayout(new FillLayout());
                pp.setLayoutData(new GridData(GridData.FILL_BOTH));
                TreeViewer tv = new TreeViewer(pp, SWT.BORDER | SWT.FULL_SELECTION);
                Tree tree = tv.getTree();
                tree.setLinesVisible(true);
                tree.setHeaderVisible(true);
                TreeColumn tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText("");
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("DB2ExplainPlanExecution.tableColumnText1"));
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("DB2ExplainPlanExecution.tableColumnText2"));
                TableLayout tableLayout = new TableLayout();
                tableLayout.addColumnData(new ColumnWeightData(6, 150, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tree.setLayout(tableLayout);
                tv.setContentProvider(new ITreeContentProvider() {

                    @Override
                    public void dispose() {
                    }

                    @Override
                    public Object[] getChildren(Object parentElement) {
                        return ((ExplainNode) parentElement).getChildren();
                    }

                    @Override
                    public Object[] getElements(Object inputElement) {
                        ExplainNode nd = ((ExplainNode) inputElement);
                        return nd.getChildren();
                    }

                    @Override
                    public Object getParent(Object element) {
                        return ((ExplainNode) element).getParent();
                    }

                    @Override
                    public boolean hasChildren(Object element) {
                        if (((ExplainNode) element).getChildren().length > 0) {
                            return true;
                        }
                        return false;
                    }

                    @Override
                    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                    }
                });
                tv.setLabelProvider(new TreeLabelProvider() {
                });
                tv.setInput(node);
                tv.refresh();
                tv.expandAll();
                // make columns full size
                for (int i = 0; i < tree.getColumnCount(); i++) {
                    tree.getColumn(i).pack();
                }
                final Composite parent = composite;
                tree.addKeyListener(new KeyAdapter() {

                    @Override
                    public void keyReleased(KeyEvent e) {
                        switch(e.keyCode) {
                            case SWT.F5:
                                // refresh SQL Results
                                try {
                                    //$NON-NLS-1$
                                    Object o = parent.getData("parenttab");
                                    if (o != null) {
                                        AbstractSQLExecution sqlExec = (AbstractSQLExecution) ((TabItem) o).getData();
                                        if (sqlExec != null) {
                                            sqlExec.startExecution();
                                        }
                                    }
                                } catch (Exception e1) {
                                    //$NON-NLS-1$
                                    SqlBuilderPlugin.log(Messages.getString("DB2ExplainPlanExecution.logMessageError1"), e1);
                                }
                                break;
                            default:
                                return;
                        }
                    }
                });
            } catch (Exception e) {
                // add message
                String message = e.getMessage();
                Label errorLabel = new Label(composite, SWT.FILL);
                errorLabel.setText(message);
                errorLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("DB2ExplainPlanExecution.logMessageError2"), e);
            }
            composite.layout();
            composite.redraw();
        }

        ;
    });
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Label(org.eclipse.swt.widgets.Label) Viewer(org.eclipse.jface.viewers.Viewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) TreeColumn(org.eclipse.swt.widgets.TreeColumn) AbstractSQLExecution(org.talend.sqlbuilder.sqlcontrol.AbstractSQLExecution) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 3 with ITreeContentProvider

use of org.eclipse.jface.viewers.ITreeContentProvider in project tdi-studio-se by Talend.

the class OracleExplainPlanExecution method displayResults.

private void displayResults(final ExplainNode node) {
    Display.getDefault().asyncExec(new Runnable() {

        @Override
        @SuppressWarnings("deprecation")
        public void run() {
            clearCanvas();
            GridLayout gLayout = new GridLayout();
            gLayout.numColumns = 2;
            gLayout.marginLeft = 0;
            gLayout.horizontalSpacing = 0;
            gLayout.verticalSpacing = 0;
            gLayout.marginWidth = 0;
            gLayout.marginHeight = 0;
            composite.setLayout(gLayout);
            try {
                //$NON-NLS-1$
                composite.setData("parenttab", parentTab);
                Composite pp = new Composite(composite, SWT.NULL);
                pp.setLayout(new FillLayout());
                pp.setLayoutData(new GridData(GridData.FILL_BOTH));
                TreeViewer tv = new TreeViewer(pp, SWT.BORDER | SWT.FULL_SELECTION);
                Tree tree = tv.getTree();
                tree.setLinesVisible(true);
                tree.setHeaderVisible(true);
                TreeColumn tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText("");
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("OracleExplainPlanExecution.tableColumnText1"));
                tc = new TreeColumn(tree, SWT.NULL);
                //$NON-NLS-1$
                tc.setText(Messages.getString("OracleExplainPlanExecution.tableColumnText2"));
                TableLayout tableLayout = new TableLayout();
                tableLayout.addColumnData(new ColumnWeightData(6, 150, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tableLayout.addColumnData(new ColumnWeightData(1, 50, true));
                tree.setLayout(tableLayout);
                tv.setContentProvider(new ITreeContentProvider() {

                    @Override
                    public void dispose() {
                    }

                    @Override
                    public Object[] getChildren(Object parentElement) {
                        return ((ExplainNode) parentElement).getChildren();
                    }

                    @Override
                    public Object[] getElements(Object inputElement) {
                        ExplainNode nd = ((ExplainNode) inputElement);
                        return nd.getChildren();
                    }

                    @Override
                    public Object getParent(Object element) {
                        return ((ExplainNode) element).getParent();
                    }

                    @Override
                    public boolean hasChildren(Object element) {
                        if (((ExplainNode) element).getChildren().length > 0) {
                            return true;
                        }
                        return false;
                    }

                    @Override
                    public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
                    }
                });
                tv.setLabelProvider(new TreeLabelProvider() {
                });
                tv.setInput(node);
                tv.refresh();
                tv.expandAll();
                // make columns full size
                for (int i = 0; i < tree.getColumnCount(); i++) {
                    tree.getColumn(i).pack();
                }
                final Composite parent = composite;
                tree.addKeyListener(new KeyAdapter() {

                    @Override
                    public void keyReleased(KeyEvent e) {
                        switch(e.keyCode) {
                            case SWT.F5:
                                // refresh SQL Results
                                try {
                                    //$NON-NLS-1$
                                    Object o = parent.getData("parenttab");
                                    if (o != null) {
                                        AbstractSQLExecution sqlExec = (AbstractSQLExecution) ((TabItem) o).getData();
                                        if (sqlExec != null) {
                                            sqlExec.startExecution();
                                        }
                                    }
                                } catch (Exception e1) {
                                    //$NON-NLS-1$
                                    SqlBuilderPlugin.log(Messages.getString("OracleExplainPlanExecution.logMessage1"), e1);
                                }
                                break;
                            default:
                                return;
                        }
                    }
                });
            } catch (Exception e) {
                // add message
                String message = e.getMessage();
                Label errorLabel = new Label(composite, SWT.FILL);
                errorLabel.setText(message);
                errorLabel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
                //$NON-NLS-1$
                SqlBuilderPlugin.log(Messages.getString("OracleExplainPlanExecution.logMessage2"), e);
            }
            composite.layout();
            composite.redraw();
        }

        ;
    });
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) KeyAdapter(org.eclipse.swt.events.KeyAdapter) Label(org.eclipse.swt.widgets.Label) Viewer(org.eclipse.jface.viewers.Viewer) TreeViewer(org.eclipse.jface.viewers.TreeViewer) FillLayout(org.eclipse.swt.layout.FillLayout) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) TreeColumn(org.eclipse.swt.widgets.TreeColumn) AbstractSQLExecution(org.talend.sqlbuilder.sqlcontrol.AbstractSQLExecution) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree) TableLayout(org.eclipse.jface.viewers.TableLayout)

Example 4 with ITreeContentProvider

use of org.eclipse.jface.viewers.ITreeContentProvider in project tdi-studio-se by Talend.

the class UseDynamicJobSelectionDialog method setCheckingNodes.

private void setCheckingNodes() {
    final IContentProvider contentProvider = getItemsTreeViewer().getContentProvider();
    final Object input = getItemsTreeViewer().getInput();
    if (contentProvider instanceof ITreeContentProvider && input instanceof ProjectRepositoryNode && getNeedCheckedjobs() != null && getNeedCheckedjobs().length > 0) {
        ITreeContentProvider cnfContentProvider = (ITreeContentProvider) contentProvider;
        List<IRepositoryNode> checkingNodes = new ArrayList<IRepositoryNode>();
        List<String> needCheckedJobIds = new ArrayList(Arrays.asList(getNeedCheckedjobs()));
        final ProjectRepositoryNode root = (ProjectRepositoryNode) input;
        final RepositoryNode rootRepositoryNode = root.getRootRepositoryNode(getSupportType());
        if (rootRepositoryNode == null) {
            return;
        }
        withReferenceProjects(cnfContentProvider, rootRepositoryNode, needCheckedJobIds, checkingNodes);
        // set check for node
        getItemsTreeViewer().setCheckedElements(checkingNodes.toArray());
        // select and will expand the selected node auto
        getItemsTreeViewer().setSelection(new StructuredSelection(checkingNodes), true);
        // let scroll bar on top
        getItemsTreeViewer().setSelection(new StructuredSelection(rootRepositoryNode));
        getItemsTreeViewer().setSelection(StructuredSelection.EMPTY);
    }
}
Also used : ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) IContentProvider(org.eclipse.jface.viewers.IContentProvider) IRepositoryNode(org.talend.repository.model.IRepositoryNode) ArrayList(java.util.ArrayList) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode) IRepositoryNode(org.talend.repository.model.IRepositoryNode)

Example 5 with ITreeContentProvider

use of org.eclipse.jface.viewers.ITreeContentProvider in project archi by archimatetool.

the class ColoursFontsPreferencePage method createColoursTab.

private void createColoursTab() {
    // Reset everything
    resetColorsCache(false);
    fImageRegistry = new ImageRegistry();
    Composite client = new Composite(fTabfolder, SWT.NULL);
    client.setLayout(new GridLayout(2, false));
    TabItem item = new TabItem(fTabfolder, SWT.NONE);
    item.setText(Messages.ColoursFontsPreferencePage_23);
    item.setControl(client);
    Label label = new Label(client, SWT.NULL);
    label.setText(Messages.ColoursFontsPreferencePage_0);
    GridData gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    label.setLayoutData(gd);
    // Tree
    fTreeViewer = new TreeViewer(client);
    gd = new GridData(GridData.FILL_BOTH);
    // need this to set a smaller height
    gd.heightHint = 80;
    fTreeViewer.getTree().setLayoutData(gd);
    // Tree Double-click listener
    fTreeViewer.addDoubleClickListener(new IDoubleClickListener() {

        @Override
        public void doubleClick(DoubleClickEvent event) {
            Object[] selected = ((IStructuredSelection) fTreeViewer.getSelection()).toArray();
            if (isValidTreeSelection(selected)) {
                RGB newRGB = openColorDialog(selected[0]);
                if (newRGB != null) {
                    for (Object object : selected) {
                        setColor(object, newRGB);
                    }
                }
            }
        }
    });
    // Tree Selection Changed Listener
    fTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {

        @Override
        public void selectionChanged(SelectionChangedEvent event) {
            Object[] selected = ((IStructuredSelection) event.getSelection()).toArray();
            fEditFillColorButton.setEnabled(isValidTreeSelection(selected));
            fResetFillColorButton.setEnabled(isValidTreeSelection(selected));
        }
    });
    // Tree Content Provider
    fTreeViewer.setContentProvider(new ITreeContentProvider() {

        @Override
        public void dispose() {
        }

        @Override
        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }

        @Override
        public Object[] getElements(Object inputElement) {
            if (inputElement instanceof String) {
                return new Object[] { new TreeGrouping(Messages.ColoursFontsPreferencePage_32, ArchimateModelUtils.getStrategyClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_7, ArchimateModelUtils.getBusinessClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_8, ArchimateModelUtils.getApplicationClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_9, ArchimateModelUtils.getTechnologyClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_33, ArchimateModelUtils.getPhysicalClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_10, ArchimateModelUtils.getMotivationClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_11, ArchimateModelUtils.getImplementationMigrationClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_17, ArchimateModelUtils.getOtherClasses()), new TreeGrouping(Messages.ColoursFontsPreferencePage_34, new Object[] { IArchimatePackage.eINSTANCE.getDiagramModelNote(), IArchimatePackage.eINSTANCE.getDiagramModelGroup() }), DEFAULT_ELEMENT_LINE_COLOR, DEFAULT_CONNECTION_LINE_COLOR };
            }
            return null;
        }

        @Override
        public Object[] getChildren(Object parentElement) {
            if (parentElement instanceof TreeGrouping) {
                return ((TreeGrouping) parentElement).children;
            }
            return null;
        }

        @Override
        public Object getParent(Object element) {
            return null;
        }

        @Override
        public boolean hasChildren(Object element) {
            return element instanceof TreeGrouping;
        }
    });
    // Tree Label Provider
    fTreeViewer.setLabelProvider(new LabelProvider() {

        @Override
        public String getText(Object element) {
            if (element instanceof EClass) {
                return ArchiLabelProvider.INSTANCE.getDefaultName((EClass) element);
            }
            if (element instanceof TreeGrouping) {
                return ((TreeGrouping) element).title;
            }
            if (element instanceof String) {
                String s = (String) element;
                if (s.equals(DEFAULT_ELEMENT_LINE_COLOR)) {
                    return Messages.ColoursFontsPreferencePage_12;
                }
                if (s.equals(DEFAULT_CONNECTION_LINE_COLOR)) {
                    return Messages.ColoursFontsPreferencePage_18;
                }
            }
            return null;
        }

        @Override
        public Image getImage(Object element) {
            if (element instanceof TreeGrouping) {
                return IArchiImages.ImageFactory.getImage(IArchiImages.ECLIPSE_IMAGE_FOLDER);
            }
            return getColorSwatch(element);
        }

        // Create a coloured image based on colour and add to the image registry
        private Image getColorSwatch(Object object) {
            String key = getColorKey(object);
            Image image = fImageRegistry.get(key);
            if (image == null) {
                image = new Image(Display.getCurrent(), 16, 16);
                GC gc = new GC(image);
                SWTGraphics graphics = new SWTGraphics(gc);
                graphics.setBackgroundColor(fColorsCache.get(object));
                graphics.fillRectangle(0, 0, 15, 15);
                graphics.drawRectangle(0, 0, 15, 15);
                gc.dispose();
                graphics.dispose();
                fImageRegistry.put(key, image);
            }
            return image;
        }
    });
    // fTreeViewer.setAutoExpandLevel(2);
    // Set Content in Tree
    // $NON-NLS-1$
    fTreeViewer.setInput("");
    // Buttons
    Composite buttonClient = new Composite(client, SWT.NULL);
    gd = new GridData(SWT.TOP, SWT.TOP, false, false);
    buttonClient.setLayoutData(gd);
    buttonClient.setLayout(new GridLayout());
    // Edit...
    fEditFillColorButton = new Button(buttonClient, SWT.PUSH);
    fEditFillColorButton.setText(Messages.ColoursFontsPreferencePage_13);
    fEditFillColorButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fEditFillColorButton.setEnabled(false);
    fEditFillColorButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            Object[] selected = ((IStructuredSelection) fTreeViewer.getSelection()).toArray();
            if (isValidTreeSelection(selected)) {
                RGB newRGB = openColorDialog(selected[0]);
                if (newRGB != null) {
                    for (Object object : selected) {
                        setColor(object, newRGB);
                    }
                }
            }
        }
    });
    // Reset
    fResetFillColorButton = new Button(buttonClient, SWT.PUSH);
    fResetFillColorButton.setText(Messages.ColoursFontsPreferencePage_14);
    fResetFillColorButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    fResetFillColorButton.setEnabled(false);
    fResetFillColorButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent event) {
            Object[] selected = ((IStructuredSelection) fTreeViewer.getSelection()).toArray();
            if (isValidTreeSelection(selected)) {
                for (Object object : selected) {
                    resetColorToInbuiltDefault(object);
                }
            }
        }
    });
    // Import Scheme
    Button importButton = new Button(buttonClient, SWT.PUSH);
    importButton.setText(Messages.ColoursFontsPreferencePage_2);
    importButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    importButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                importUserColors();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    });
    // Export Scheme
    Button exportButton = new Button(buttonClient, SWT.PUSH);
    exportButton.setText(Messages.ColoursFontsPreferencePage_3);
    exportButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    exportButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            try {
                exportUserColors();
            } catch (IOException ex) {
                ex.printStackTrace();
            }
        }
    });
    Group elementColorGroup = new Group(client, SWT.NULL);
    elementColorGroup.setLayout(new GridLayout(2, false));
    elementColorGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    elementColorGroup.setText(Messages.ColoursFontsPreferencePage_20);
    // Derive element line colours
    fDeriveElementLineColorsButton = new Button(elementColorGroup, SWT.CHECK);
    fDeriveElementLineColorsButton.setText(Messages.ColoursFontsPreferencePage_19);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    fDeriveElementLineColorsButton.setLayoutData(gd);
    fDeriveElementLineColorsButton.setSelection(getPreferenceStore().getBoolean(DERIVE_ELEMENT_LINE_COLOR));
    fDeriveElementLineColorsButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            fElementLineColorContrastSpinner.setEnabled(fDeriveElementLineColorsButton.getSelection());
            fContrastFactorLabel.setEnabled(fDeriveElementLineColorsButton.getSelection());
        }
    });
    fContrastFactorLabel = new Label(elementColorGroup, SWT.NULL);
    fContrastFactorLabel.setText(Messages.ColoursFontsPreferencePage_21);
    fElementLineColorContrastSpinner = new Spinner(elementColorGroup, SWT.BORDER);
    fElementLineColorContrastSpinner.setMinimum(1);
    fElementLineColorContrastSpinner.setMaximum(10);
    fElementLineColorContrastSpinner.setSelection(getPreferenceStore().getInt(DERIVE_ELEMENT_LINE_COLOR_FACTOR));
    label = new Label(elementColorGroup, SWT.NULL);
    label.setText(Messages.ColoursFontsPreferencePage_22);
    gd = new GridData(GridData.FILL_HORIZONTAL);
    gd.horizontalSpan = 2;
    // Persist user default colours
    fPersistUserDefaultColors = new Button(client, SWT.CHECK);
    fPersistUserDefaultColors.setText(Messages.ColoursFontsPreferencePage_1);
    fPersistUserDefaultColors.setLayoutData(gd);
    fPersistUserDefaultColors.setSelection(getPreferenceStore().getBoolean(SAVE_USER_DEFAULT_COLOR));
    // Use colours in application
    fShowUserDefaultFillColorsInApplication = new Button(client, SWT.CHECK);
    fShowUserDefaultFillColorsInApplication.setText(Messages.ColoursFontsPreferencePage_6);
    fShowUserDefaultFillColorsInApplication.setLayoutData(gd);
    fShowUserDefaultFillColorsInApplication.setSelection(getPreferenceStore().getBoolean(SHOW_FILL_COLORS_IN_GUI));
}
Also used : ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) Group(org.eclipse.swt.widgets.Group) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Spinner(org.eclipse.swt.widgets.Spinner) CLabel(org.eclipse.swt.custom.CLabel) Label(org.eclipse.swt.widgets.Label) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) TreeViewer(org.eclipse.jface.viewers.TreeViewer) Viewer(org.eclipse.jface.viewers.Viewer) Image(org.eclipse.swt.graphics.Image) GridLayout(org.eclipse.swt.layout.GridLayout) EClass(org.eclipse.emf.ecore.EClass) Button(org.eclipse.swt.widgets.Button) IDoubleClickListener(org.eclipse.jface.viewers.IDoubleClickListener) SelectionEvent(org.eclipse.swt.events.SelectionEvent) GC(org.eclipse.swt.graphics.GC) Composite(org.eclipse.swt.widgets.Composite) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) DoubleClickEvent(org.eclipse.jface.viewers.DoubleClickEvent) IOException(java.io.IOException) RGB(org.eclipse.swt.graphics.RGB) TabItem(org.eclipse.swt.widgets.TabItem) SWTGraphics(org.eclipse.draw2d.SWTGraphics) ImageRegistry(org.eclipse.jface.resource.ImageRegistry) GridData(org.eclipse.swt.layout.GridData) ArchiLabelProvider(com.archimatetool.editor.ui.ArchiLabelProvider) LabelProvider(org.eclipse.jface.viewers.LabelProvider)

Aggregations

ITreeContentProvider (org.eclipse.jface.viewers.ITreeContentProvider)67 Viewer (org.eclipse.jface.viewers.Viewer)31 LabelProvider (org.eclipse.jface.viewers.LabelProvider)18 GridData (org.eclipse.swt.layout.GridData)18 Composite (org.eclipse.swt.widgets.Composite)16 TreeViewer (org.eclipse.jface.viewers.TreeViewer)15 GridLayout (org.eclipse.swt.layout.GridLayout)14 ILabelProvider (org.eclipse.jface.viewers.ILabelProvider)12 ViewerComparator (org.eclipse.jface.viewers.ViewerComparator)12 Label (org.eclipse.swt.widgets.Label)12 CheckStateChangedEvent (org.eclipse.jface.viewers.CheckStateChangedEvent)11 ICheckStateListener (org.eclipse.jface.viewers.ICheckStateListener)11 ViewerFilter (org.eclipse.jface.viewers.ViewerFilter)11 WorkbenchContentProvider (org.eclipse.ui.model.WorkbenchContentProvider)11 WorkbenchLabelProvider (org.eclipse.ui.model.WorkbenchLabelProvider)11 ArrayList (java.util.ArrayList)10 CheckboxTreeViewer (org.eclipse.jface.viewers.CheckboxTreeViewer)9 ElementTreeSelectionDialog (org.eclipse.ui.dialogs.ElementTreeSelectionDialog)9 StructuredViewer (org.eclipse.jface.viewers.StructuredViewer)8 SourceViewer (org.eclipse.jface.text.source.SourceViewer)7