Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.IContentProvider


    return model;
  }

  private boolean isGroupingEnabled() {
    IContentProvider contentProvider = fViewer.getContentProvider();
    if (contentProvider != null && contentProvider instanceof NewsContentProvider)
      return ((NewsContentProvider) contentProvider).isGroupingEnabled();

    return false;
  }
View Full Code Here


    return false;
  }

  private boolean isGroupingByFeed() {
    IContentProvider contentProvider = fViewer.getContentProvider();
    if (contentProvider != null && contentProvider instanceof NewsContentProvider)
      return ((NewsContentProvider) contentProvider).isGroupingByFeed();

    return false;
  }
View Full Code Here

    return false;
  }

  private boolean isGroupingByStickyness() {
    IContentProvider contentProvider = fViewer.getContentProvider();
    if (contentProvider != null && contentProvider instanceof NewsContentProvider)
      return ((NewsContentProvider) contentProvider).isGroupingByStickyness();

    return false;
  }
View Full Code Here

    private void createViewer(Composite parent)
    {
        viewComposite = new Composite(parent, SWT.NONE);
        viewComposite.setLayout(new FillLayout());
        viewer = new GraphViewer(viewComposite, SWT.H_SCROLL | SWT.V_SCROLL);
        IContentProvider contentProvider = new BundleGraphContentProvider();
        viewer.setContentProvider(contentProvider);
        viewer.setLabelProvider(new BundleGraphLabelProvider(this));
        viewer.addFilter(new BundleGraphViewFilter(this));

        int style = LayoutStyles.NO_LAYOUT_NODE_RESIZING;
View Full Code Here

  /**
   * @return a object to be tested.
   */
  protected ForwardingContentProvider create() {
    final IContentProvider content = newProxy(IContentProvider.class);
    return new ForwardingContentProvider() {
      @Override
      protected IContentProvider delegate() {
        return content;
      }
View Full Code Here

    }

    private void disposeTableViewer() {
        if (tableViewer == null)
            return;
        IContentProvider contentProvider = tableViewer.getContentProvider();
        if (contentProvider != null)
            contentProvider.dispose();
        IBaseLabelProvider labelProvider = tableViewer.getLabelProvider();
        if (labelProvider != null)
            labelProvider.dispose();
        Control control = tableViewer.getControl();
        if (control != null)
View Full Code Here

  private IAction createShowGroupsAction(){
    final Action action =new Action(Messages.IssuesView_showGroups, IAction.AS_CHECK_BOX ){
      @Override
      public void runWithEvent(Event event) {
        IContentProvider contentProvider = viewer.getContentProvider();
                if( contentProvider instanceof IssuesContentProvider ){
                    IssuesContentProvider provider=(IssuesContentProvider) contentProvider;
            provider.setShowGroup(isChecked());
            refresh(true);
                }
View Full Code Here

        data.widthHint = MIN_TREE_WIDTH;
        tree.setLayoutData(data);


        // Set its content provider and label provider
        final IContentProvider contentProvider =
            new StyleCategoriesContentProvider();
        final ILabelProvider labelProvider = new StyleCategoriesLabelProvider();
        categoryTreeViewer.setContentProvider(contentProvider);
        categoryTreeViewer.setLabelProvider(labelProvider);

        // create the node collapse listener. We need this listener to ensure
        // that a node is always selected. If a node is expanded and one of
        // its children is the selected node the tree will have no nodes
        // selected when the expanded node is collapsed.
        collapseListener = new ITreeViewerListener() {
            // javadoc inherited
            public void treeCollapsed(TreeExpansionEvent event) {
                // If the colapse event has resulted in nothing being selected
                // then ensure that the node that was collapsed is selected
                if (categoryTreeViewer.getSelection().isEmpty()) {
                    categoryTreeViewer.setSelection(
                                new StructuredSelection(event.getElement()));
                }
            }

            // javadoc inherited
            public void treeExpanded(TreeExpansionEvent event) {
                // not interested in expansion events
            }
        };
        // register the listener with the viewer
        categoryTreeViewer.addTreeListener(collapseListener);

        // Now set the input to the top-level categories: in single-select
        // mode, this will automatically cause the first one to be selected
        // which is what we want
        categoryTreeViewer.setInput(categories);

        // Listen for disposal
        this.addDisposeListener(new DisposeListener() {
            public void widgetDisposed(DisposeEvent event) {
                contentProvider.dispose();
                labelProvider.dispose();
                categoryTreeViewer.removeTreeListener(collapseListener);
            }
        });
View Full Code Here

    update();
    this.state = !state;
  }

  protected void update() {
    IContentProvider contentProvider = getViewer().getContentProvider();
    if (contentProvider instanceof DeferedContentProvider) {
      DeferedContentProvider ds = (DeferedContentProvider) contentProvider;
      contentProvider = ds.getBase();
    }
    getViewer().getControl().setRedraw(false);
View Full Code Here

                processDoubleClick();
            }
        });

        //Never show debug info
        IContentProvider provider = new ProgressViewerContentProvider(viewer,
                false,false);
        viewer.setContentProvider(provider);
        viewer.setInput(provider);
        viewer.setLabelProvider(new ProgressViewerLabelProvider(viewerControl));
        viewer.setComparator(ProgressManagerUtil.getProgressViewerComparator());
View Full Code Here

TOP

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

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.