Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreeViewer


     * @param entryEditor the entry editor
     */
    public EntryEditorActionGroup( EntryEditor entryEditor )
    {
        super( entryEditor.getMainWidget(), entryEditor.getConfiguration() );
        TreeViewer viewer = entryEditor.getMainWidget().getViewer();
        ValueEditorManager valueEditorManager = entryEditor.getConfiguration().getValueEditorManager( viewer );

        // create OpenDefaultEditorAction with enabled rename action flag
        openDefaultValueEditorActionProxy.dispose();
        openDefaultValueEditorActionProxy = new EntryEditorActionProxy( viewer, new OpenDefaultEditorAction( viewer,
View Full Code Here


     * @param configuration the connection widget configuration
     */
    public ConnectionActionGroup( ConnectionWidget mainWidget, ConnectionConfiguration configuration )
    {
        this.mainWidget = mainWidget;
        TreeViewer viewer = mainWidget.getViewer();

        collapseAllAction = new CollapseAllAction( viewer );
        expandAllAction = new ExpandAllAction( viewer );

        connectionActionMap = new HashMap<String, ConnectionViewActionProxy>();

        connectionActionMap.put( newConnectionAction, new ConnectionViewActionProxy( viewer, this,
            new NewConnectionAction() ) );
        connectionActionMap.put( newConnectionFolderAction, new ConnectionViewActionProxy( viewer, this,
            new NewConnectionFolderAction() ) );
        connectionActionMap.put( openConnectionAction, new ConnectionViewActionProxy( viewer, this,
            new OpenConnectionAction() ) );
        connectionActionMap.put( closeConnectionAction, new ConnectionViewActionProxy( viewer, this,
            new CloseConnectionAction() ) );
        connectionActionMap
            .put( pasteConnectionAction, new ConnectionViewActionProxy( viewer, this, new PasteAction() ) );
        connectionActionMap.put( copyConnectionAction, new ConnectionViewActionProxy( viewer, this, new CopyAction(
            ( StudioActionProxy ) connectionActionMap.get( pasteConnectionAction ) ) ) );
        connectionActionMap.put( deleteConnectionAction, new ConnectionViewActionProxy( viewer, this,
            new DeleteAction() ) );
        connectionActionMap.put( renameConnectionAction, new ConnectionViewActionProxy( viewer, this,
            new RenameAction() ) );
        connectionActionMap.put( propertyDialogAction, new ConnectionViewActionProxy( viewer, this,
            new PropertiesAction() ) );

        // DND support
        dropConnectionListener = new DropConnectionListener();
        dragConnectionListener = new DragConnectionListener( viewer );
        int ops = DND.DROP_COPY | DND.DROP_MOVE;
        Transfer[] transfers = new Transfer[]
            { ConnectionTransfer.getInstance() };
        viewer.addDragSupport( ops, transfers, dragConnectionListener );
        viewer.addDropSupport( ops, transfers, dropConnectionListener );
    }
View Full Code Here

    @Override
    public void createControl(Composite parent) {
        super.createControl(parent);

        TreeViewer viewer = getTreeViewer();
        viewer.setAutoExpandLevel(2);
        viewer.setContentProvider(new BndEditorContentOutlineProvider(viewer));
        viewer.setLabelProvider(new BndEditorContentOutlineLabelProvider());

        viewer.addSelectionChangedListener(new ISelectionChangedListener() {
            public void selectionChanged(SelectionChangedEvent event) {
                IStructuredSelection selection = (IStructuredSelection) event.getSelection();
                Object element = selection.getFirstElement();

                if (element instanceof String) {
                    if (BndEditorContentOutlineProvider.EXPORTS.equals(element)) {
                        editor.setActivePage(BndEditor.CONTENT_PAGE);
                    } else if (BndEditorContentOutlineProvider.IMPORT_PATTERNS.equals(element)) {
                        editor.setActivePage(BndEditor.CONTENT_PAGE);
                    } else if (BndEditorContentOutlineProvider.PRIVATE_PKGS.equals(element)) {
                        editor.setActivePage(BndEditor.CONTENT_PAGE);
                    } else if (BndEditorContentOutlineProvider.PLUGINS.equals(element)) {
                        editor.setActivePage(BndEditor.WORKSPACE_PAGE);
                    } else {
                        editor.setActivePage((String) element);
                    }
                } else if (element instanceof ExportedPackage) {
                    BundleContentPage contentsPage = (BundleContentPage) editor.setActivePage(BndEditor.CONTENT_PAGE);
                    if (contentsPage != null) {
                        contentsPage.setSelectedExport((ExportedPackage) element);
                    }
                } else if (element instanceof PrivatePkg) {
                    BundleContentPage contentsPage = (BundleContentPage) editor.setActivePage(BndEditor.CONTENT_PAGE);
                    if (contentsPage != null) {
                        contentsPage.setSelectedPrivatePkg(((PrivatePkg) element).pkg);
                    }
                } else if (element instanceof ImportPattern) {
                    BundleContentPage contentsPage = (BundleContentPage) editor.setActivePage(BndEditor.CONTENT_PAGE);
                    if (contentsPage != null) {
                        contentsPage.setSelectedImport((ImportPattern) element);
                    }
                } else if (element instanceof PluginClause) {
                    WorkspacePage workspacePage = (WorkspacePage) editor.setActivePage(BndEditor.WORKSPACE_PAGE);
                    if (workspacePage != null)
                        workspacePage.setSelectedPlugin(((PluginClause) element).header);
                }
            }
        });

        viewer.setInput(model);
    }
View Full Code Here

        // toolkit.createLabel(composite,
        // Messages.BundleCalculatedImportsPart_description, SWT.WRAP);

        tree = toolkit.createTree(composite, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);

        viewer = new TreeViewer(tree);
        viewer.setContentProvider(new ImportTreeContentProvider());
        viewer.setSorter(new ImportsAndExportsViewerSorter());
        viewer.setLabelProvider(new ImportsExportsTreeLabelProvider());

        hideSelfImportsFilter = new ViewerFilter() {
View Full Code Here

        txtSearch.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

        Tree tree = toolkit.createTree(container, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL);
        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));

        viewer = new TreeViewer(tree);
        contentProvider.setShowRepos(false);
        viewer.setContentProvider(contentProvider);
        viewer.setLabelProvider(new RepositoryTreeLabelProvider(true));
        viewer.setFilters(new ViewerFilter[] {
            includedRepoFilter
View Full Code Here

        gd = new GridData(SWT.FILL, SWT.FILL, true, true);
        gd.widthHint = 200;
        gd.heightHint = 150;
        sectReason.setLayoutData(gd);

        reasonsViewer = new TreeViewer(tblReasons);
        reasonsViewer.setContentProvider(reasonsContentProvider);
        reasonsViewer.setLabelProvider(new ResolutionTreeLabelProvider());
    }
View Full Code Here

        gd = new GridData(SWT.FILL, SWT.FILL, true, false);
        gd.widthHint = 600;
        gd.heightHint = 300;
        sectUnresolved.setLayoutData(gd);

        unresolvedViewer = new TreeViewer(treeUnresolved);
        unresolvedViewer.setContentProvider(new UnresolvedRequirementsContentProvider());
        unresolvedViewer.setLabelProvider(new RequirementWithResourceLabelProvider());
        setFailureViewMode();
    }
View Full Code Here

    Tree orgTable = new Tree(orgTableComposite, SWT.BORDER | SWT.SINGLE);

    GridDataFactory.fillDefaults().grab(true, true).applyTo(orgTable);

    orgsSpacesViewer = new TreeViewer(orgTable);

    orgsSpacesViewer.setContentProvider(new TableContentProvider());
    orgsSpacesViewer.setLabelProvider(new SpacesLabelProvider());
    orgsSpacesViewer.setSorter(new SpacesSorter());
View Full Code Here

    /**
     * @param tree
     */
    private void createContentsViewer(Tree tree)
    {
        treeViewer = new TreeViewer(tree);
        treeViewer.setContentProvider(new DefaultTreeContentProvider()
        {
            public Object[] getChildren(Object parentElement)
            {
                if (parentElement instanceof ICompoundModelElement)
View Full Code Here

    {
        Composite composite = (Composite) super.createDialogArea(parent);
        new Label(composite, SWT.NONE).setText("Select bundle form file from workspace:");
        Tree tree = new Tree(composite, SWT.SINGLE);

        TreeViewer viewer = new TreeViewer(tree);
        viewer.setContentProvider(new BaseWorkbenchContentProvider());
        viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
        viewer.addSelectionChangedListener(new ISelectionChangedListener()
        {
            public void selectionChanged(SelectionChangedEvent evt)
            {
                if (evt.getSelection().isEmpty())
                {
                    updateFile(null);
                }
                else
                {
                    StructuredSelection sel = (StructuredSelection) evt.getSelection();
                    IResource r = (IResource) sel.getFirstElement();
                    if (r instanceof IFile)
                    {
                        IFile f = (IFile) r;
                        updateFile(f);
                    }
                    else
                    {
                        updateFile(null);
                    }
                }
            }
        });
        viewer.setLabelProvider(new WorkbenchLabelProvider());

        tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

        return composite;
    }
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.TreeViewer

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.