Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.TreeViewer


    DynamicDAO.saveAll(labelsToSave);
  }

  private void createViewer(Composite container) {
    fViewer = new TreeViewer(container, SWT.FULL_SELECTION | SWT.BORDER | SWT.MULTI);
    fViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    ((GridData) fViewer.getTree().getLayoutData()).heightHint = 190;
    fViewer.getTree().setFont(OwlUI.getBold(JFaceResources.DIALOG_FONT));
    fViewer.getTree().setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, new Object());
View Full Code Here


      }
    }
  }

  private void expandNewsTableViewerGroups(boolean delayRedraw, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Remember TopItem if required */
    TreeItem topItem = oldSelection.isEmpty() ? tree.getTopItem() : null;

    /* Expand All & Restore Selection with redraw false */
    if (delayRedraw)
      tree.getParent().setRedraw(false);
    try {
      viewer.expandAll();

      /* Restore selection if required */
      if (!oldSelection.isEmpty() && viewer.getSelection().isEmpty())
        viewer.setSelection(oldSelection, true);
      else if (topItem != null)
        tree.setTopItem(topItem);
    } finally {
      if (delayRedraw)
        tree.getParent().setRedraw(true);
View Full Code Here

    }
  }

  /* TODO This is a Workaround until Eclipse Bug #159586 is fixed */
  private void stableSetInputToNewsTable(Object input, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Set Input & Restore Selection with redraw false */
    tree.getParent().setRedraw(false);
    try {
      fNewsTableControl.setPartInput(input);

      /* Restore selection if required */
      if (oldSelection != null) {
        fNewsTableControl.setBlockNewsStateTracker(true);
        try {
          viewer.setSelection(oldSelection);
        } finally {
          fNewsTableControl.setBlockNewsStateTracker(false);
        }
      }

View Full Code Here

    fFolderViewerContainer.setBackground(fParent.getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));

    Label separator = new Label(fFolderViewerContainer, SWT.SEPARATOR | SWT.HORIZONTAL);
    separator.setLayoutData(new GridData(SWT.FILL, SWT.BEGINNING, true, false));

    fFolderViewer = new TreeViewer(fFolderViewerContainer, SWT.None);
    fFolderViewer.setAutoExpandLevel(2);
    fFolderViewer.getTree().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    fFolderViewer.getTree().setData(ApplicationWorkbenchWindowAdvisor.FOCUSLESS_SCROLL_HOOK, new Object());

    fViewerHeight = fFolderViewer.getTree().getItemHeight() * fItemHeight + 12;
View Full Code Here

      }
    }
  }

  private void expandNewsTableViewerGroups(boolean delayRedraw, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Remember TopItem if required */
    TreeItem topItem = oldSelection.isEmpty() ? tree.getTopItem() : null;

    /* Expand All & Restore Selection with redraw false */
    if (delayRedraw)
      tree.getParent().setRedraw(false);
    try {
      viewer.expandAll();

      /* Restore selection if required */
      if (!oldSelection.isEmpty() && viewer.getSelection().isEmpty())
        viewer.setSelection(oldSelection, true);
      else if (topItem != null)
        tree.setTopItem(topItem);
    } finally {
      if (delayRedraw)
        tree.getParent().setRedraw(true);
View Full Code Here

    }
  }

  /* TODO This is a Workaround until Eclipse Bug #159586 is fixed */
  private void stableSetInputToNewsTable(Object input, ISelection oldSelection) {
    TreeViewer viewer = fNewsTableControl.getViewer();
    Tree tree = (Tree) viewer.getControl();

    /* Set Input & Restore Selection with redraw false */
    tree.getParent().setRedraw(false);
    try {
      fNewsTableControl.setPartInput(input);

      /* Restore selection if required */
      if (oldSelection != null) {
        fNewsTableControl.setBlockNewsStateTracker(true);
        try {
          viewer.setSelection(oldSelection);
        } finally {
          fNewsTableControl.setBlockNewsStateTracker(false);
        }
      }

View Full Code Here

     *
     * @see org.eclipse.ui.IWorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
     */
    public void createPartControl(Composite parent) {
        Tree tree = new Tree(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
        viewer = new TreeViewer(tree);
        viewer.setLabelProvider(new ProseRunLabelProvider());
        viewer.setContentProvider(new ProseRunContentProvider());
        viewer.setInput(new ArrayList());
        createContextMenu();

View Full Code Here

                .getPreferenceStore();
        String orientString = prefStore
                .getString(IDebugPreferenceConstants.VARIABLES_DETAIL_PANE_ORIENTATION);
        setDetailPaneOrientation(orientString);

        final TreeViewer variablesViewer = new DroolsVariablesViewer(getSashForm(),
                SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL, this);
        variablesViewer.setContentProvider(createContentProvider());
        variablesViewer.setLabelProvider(new VariablesViewLabelProvider(
                getModelPresentation()));
        variablesViewer.setUseHashlookup(true);
        variablesViewer.getControl().addFocusListener(new FocusAdapter() {
            public void focusGained(FocusEvent e) {
                getVariablesViewSelectionProvider()
                        .setUnderlyingSelectionProvider(variablesViewer);
                setAction(SELECT_ALL_ACTION,
                        getAction(VARIABLES_SELECT_ALL_ACTION));
                setAction(COPY_ACTION, getAction(VARIABLES_COPY_ACTION));
                getViewSite().getActionBars().updateActionBars();
                setFocusViewer(getVariablesViewer());
            }
        });
        variablesViewer
                .addSelectionChangedListener(getTreeSelectionChangedListener());
        getVariablesViewSelectionProvider().setUnderlyingSelectionProvider(
                variablesViewer);
        getSite().setSelectionProvider(getVariablesViewSelectionProvider());

        SourceViewer detailsViewer = new SourceViewer(getSashForm(), null,
                SWT.V_SCROLL | SWT.H_SCROLL);
        setDetailViewer(detailsViewer);
        detailsViewer.setDocument(getDetailDocument());
        detailsViewer.getTextWidget().setFont(
                JFaceResources
                        .getFont(IInternalDebugUIConstants.DETAIL_PANE_FONT));
        getDetailDocument().addDocumentListener(getDetailDocumentListener());
        detailsViewer.setEditable(false);
        getSashForm().setMaximizedControl(variablesViewer.getControl());

        detailsViewer.getSelectionProvider().addSelectionChangedListener(
                getDetailSelectionChangedListener());

        detailsViewer.getControl().addFocusListener(new FocusAdapter() {
View Full Code Here

                return;
            }
            IStructuredSelection ss = (IStructuredSelection) selection;
            Object o = ss.getFirstElement();

            TreeViewer tViewer = (TreeViewer) getViewer();
            boolean expanded = tViewer.getExpandedState(o);
            tViewer.setExpandedState(o, !expanded);
        }
    }
View Full Code Here

     */
    public ConnectionViewActionGroup( ConnectionView view )
    {
        super( view.getMainWidget(), view.getConfiguration() );
        this.view = view;
        TreeViewer viewer = view.getMainWidget().getViewer();

        linkWithEditorAction = new LinkWithEditorAction( view );
        connectionActionMap.put( importDsmlAction, new ConnectionViewActionProxy( viewer, this, new ImportExportAction(
            ImportExportAction.TYPE_IMPORT_DSML ) ) );
        connectionActionMap.put( exportDsmlAction, new ConnectionViewActionProxy( viewer, this, new ImportExportAction(
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.