Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.StructuredViewer


  public void init(ICommonActionExtensionSite actionSite) {
    super.init(actionSite);
    ICommonViewerSite site = actionSite.getViewSite();
    if (site instanceof ICommonViewerWorkbenchSite) {
      StructuredViewer viewer = actionSite.getStructuredViewer();
      if (viewer instanceof CommonViewer) {
        CommonViewer serversViewer = (CommonViewer) viewer;
        serversViewer.addOpenListener(new IOpenListener() {
          public void open(OpenEvent event) {
            ISelection s = event.getSelection();
View Full Code Here


    }

    @Override
    public String getLabel() {
        final String label = super.getLabel();
        final StructuredViewer viewer = getViewer();
        if (viewer instanceof TableViewer) {
            final TableViewer tv = (TableViewer) viewer;

            final AbstractTextSearchResult result = getInput();
            if (result != null) {
View Full Code Here

    public Object execute(final ExecutionEvent event) throws ExecutionException {
        final Object activePart = HandlerUtil.getVariable(event, "activePart");
        final String targetId;
        final Shell shell;
        PatternFilter patternFilter;
        StructuredViewer viewer;
        if (activePart instanceof ContentOutline) {
            final ContentOutline outline = (ContentOutline) activePart;
            final ErlangOutlinePage erlangOutlinePage = (ErlangOutlinePage) outline
                    .getAdapter(ErlangOutlinePage.class);
            shell = outline.getSite().getShell();
View Full Code Here

                            true);
                    EditorUtility.revealInEditor(part, selectedElement);
                }
                if (selectedElement != null) {
                    if (selectedElement instanceof IErlExternal) {
                        final StructuredViewer structuredViewer = site
                                .getStructuredViewer();
                        if (structuredViewer instanceof AbstractTreeViewer) {
                            final AbstractTreeViewer treeViewer = (AbstractTreeViewer) structuredViewer;
                            final boolean expanded = treeViewer
                                    .getExpandedState(selectedElement);
View Full Code Here

    @Override
    public void init(ICommonActionExtensionSite aSite) {
        site = aSite;
        super.init(aSite);
        final StructuredViewer viewer = aSite.getStructuredViewer();
        final BugContentProvider provider = BugContentProvider.getProvider(site.getContentService());

        filterChangeListener = new IPropertyChangeListener() {

            public void propertyChange(PropertyChangeEvent event) {
                if (!initDone) {
                    return;
                }
                IWorkingSet oldWorkingSet = provider.getCurrentWorkingSet();
                IWorkingSet oldWorkingSet1 = (IWorkingSet) event.getOldValue();
                IWorkingSet newWorkingSet = (IWorkingSet) event.getNewValue();
                if (newWorkingSet != null && (oldWorkingSet == newWorkingSet || oldWorkingSet1 == newWorkingSet)) {
                    return;
                }
                if (viewer != null) {
                    provider.setCurrentWorkingSet(newWorkingSet);
                    if (newWorkingSet == null) {
                        viewer.setInput(ResourcesPlugin.getWorkspace().getRoot());
                    } else if (oldWorkingSet != newWorkingSet) {
                        viewer.setInput(newWorkingSet);
                    }
                }
            }
        };


        workingSetActionGroup = new WorkingSetFilterActionGroup(aSite.getViewSite().getShell(), filterChangeListener);
        if (provider == null)
            throw new NullPointerException("no provider");
        workingSetActionGroup.setWorkingSet(provider.getCurrentWorkingSet());
        doubleClickAction = new MyAction();
        // only if doubleClickAction must know tree selection:
        viewer.addSelectionChangedListener(doubleClickAction);
        initDone = true;
    }
View Full Code Here

                            op.run(monitor);
                            if (shell != null && !shell.isDisposed()) {
                                shell.getDisplay().asyncExec(new Runnable() {
                                    @Override
                                    public void run() {
                                        StructuredViewer viewer = getActionSite().getStructuredViewer();
                                        if (viewer != null && viewer.getControl() != null && !viewer.getControl().isDisposed()) {
                                            viewer.refresh();
                                        }
                                    }
                                });
                            }
                        } catch (InvocationTargetException e) {
View Full Code Here

            public void run() {
                if (viewer == null || viewer.getControl().isDisposed())
                    return;

                if (viewer instanceof StructuredViewer) {
                    StructuredViewer structuredViewer = (StructuredViewer) viewer;
                    structuredViewer.update(element, properties);
                } else {
                    viewer.refresh();
                }
            }
        });
View Full Code Here

            public void run() {
                if (viewer == null || viewer.getControl().isDisposed())
                    return;

                if (viewer instanceof StructuredViewer) {
                    StructuredViewer structuredViewer = (StructuredViewer) viewer;
                    structuredViewer.update(elements, properties);
                } else {
                    viewer.refresh();
                }
            }
        });
View Full Code Here

            public void run() {
                if (viewer == null || viewer.getControl().isDisposed())
                    return;

                if (viewer instanceof StructuredViewer) {
                    StructuredViewer structuredViewer = (StructuredViewer) viewer;
                    structuredViewer.refresh(updateLabels);
                } else {
                    viewer.refresh();
                }
            }
        });
View Full Code Here

              }
              createBindingsWithButton(c, m, bnd,
                  new Field[] { singleField }, facade, false);
              int open = dlg.open();
              if (open == Dialog.OK) {
                StructuredViewer viewer = v.getViewer();
                if (viewer instanceof TableViewer) {
                  Binding bb = bnd.getBinding(f.name);
                  Object value = bb.getValue();
                  if (value == null || bb.isReadOnly()) {
                    value = new NullValue();
View Full Code Here

TOP

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

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.