Search in sources :

Example 6 with TreeViewer

use of org.eclipse.jface.viewers.TreeViewer in project translationstudio8 by heartsome.

the class TmDbManagerDialog method createTreeViewer.

/**
	 * Create a new <code>TreeViewer</code>.
	 * @param parent
	 *            the parent <code>Composite</code>.
	 * @return the <code>TreeViewer</code>.
	 */
protected TreeViewer createTreeViewer(Composite parent) {
    final TreeViewer viewer = new TreeViewer(parent, SWT.BORDER);
    addListeners(viewer);
    viewer.setLabelProvider(new TreeLableProvider());
    viewer.setContentProvider(new TreeContentProvider());
    return viewer;
}
Also used : ITreeContentProvider(org.eclipse.jface.viewers.ITreeContentProvider) TreeViewer(org.eclipse.jface.viewers.TreeViewer)

Example 7 with TreeViewer

use of org.eclipse.jface.viewers.TreeViewer in project azure-tools-for-java by Microsoft.

the class ServiceExplorerView method createPartControl.

/**
     * This is a callback that will allow us
     * to create the viewer and initialize it.
     */
public void createPartControl(Composite parent) {
    viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
    viewer.setSorter(new NameSorter());
    viewer.setInput(getViewSite());
    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "com.microsoft.azuretools.azureexplorer.viewer");
    makeActions();
    hookContextMenu();
    hookMouseActions();
    contributeToActionBars();
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer)

Example 8 with TreeViewer

use of org.eclipse.jface.viewers.TreeViewer in project KaiZen-OpenAPI-Editor by RepreZen.

the class JsonContentOutlinePage method createControl.

@Override
public void createControl(Composite parent) {
    super.createControl(parent);
    TreeViewer viewer = getTreeViewer();
    viewer.setContentProvider(new OutlineContentProvider());
    viewer.setLabelProvider(new OutlineStyledLabelProvider());
    viewer.addSelectionChangedListener(this);
    viewer.setAutoExpandLevel(2);
    viewer.setUseHashlookup(true);
    if (currentInput != null) {
        setInput(currentInput);
    }
}
Also used : TreeViewer(org.eclipse.jface.viewers.TreeViewer)

Example 9 with TreeViewer

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

the class CreateDiagramAction method setRepositoryNode.

private void setRepositoryNode(Properties params) {
    IWorkbenchWindow workbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
    if (null == workbenchWindow) {
        return;
    }
    IWorkbenchPage workbenchPage = workbenchWindow.getActivePage();
    if (null == workbenchPage) {
        return;
    }
    IPerspectiveDescriptor currentPerspective = workbenchPage.getPerspective();
    if (!IBrandingConfiguration.PERSPECTIVE_DI_ID.equals(currentPerspective.getId())) {
        // show di perspective
        try {
            workbenchWindow.getWorkbench().showPerspective(IBrandingConfiguration.PERSPECTIVE_DI_ID, workbenchWindow);
            workbenchPage = workbenchWindow.getActivePage();
        } catch (WorkbenchException e) {
            ExceptionHandler.process(e);
            return;
        }
    }
    // bug 16594
    IRepositoryView view = RepositoryManagerHelper.getRepositoryView();
    if (view != null) {
        Object type = params.get("type");
        if (ERepositoryObjectType.BUSINESS_PROCESS != null && ERepositoryObjectType.BUSINESS_PROCESS.name().equals(type)) {
            RepositoryNode processNode = ((ProjectRepositoryNode) view.getRoot()).getRootRepositoryNode(ERepositoryObjectType.BUSINESS_PROCESS);
            final StructuredViewer viewer = view.getViewer();
            if (viewer instanceof TreeViewer) {
                ((TreeViewer) viewer).expandToLevel(processNode, 1);
            }
            this.repositoryNode = processNode;
        }
    }
}
Also used : IWorkbenchWindow(org.eclipse.ui.IWorkbenchWindow) TreeViewer(org.eclipse.jface.viewers.TreeViewer) IWorkbenchPage(org.eclipse.ui.IWorkbenchPage) IPerspectiveDescriptor(org.eclipse.ui.IPerspectiveDescriptor) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) StructuredViewer(org.eclipse.jface.viewers.StructuredViewer) WorkbenchException(org.eclipse.ui.WorkbenchException) IRepositoryView(org.talend.repository.ui.views.IRepositoryView) ProjectRepositoryNode(org.talend.core.repository.model.ProjectRepositoryNode) RepositoryNode(org.talend.repository.model.RepositoryNode)

Example 10 with TreeViewer

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

the class ErrorDetailDialog method createTreeTableViewer.

/**
     * DOC chuang Comment method "createTreeTableView".
     * 
     * @param parent
     */
private void createTreeTableViewer(Composite parent) {
    Composite composite = new Composite(parent, SWT.NONE);
    composite.setLayout(new GridLayout());
    composite.setLayoutData(new GridData(GridData.FILL_BOTH));
    viewer = new TreeViewer(composite, SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    // init tree
    final Tree tree = viewer.getTree();
    tree.setHeaderVisible(true);
    tree.setLinesVisible(true);
    tree.setLayoutData(new GridData(GridData.FILL_BOTH));
    // create tree column
    TreeColumn column = new TreeColumn(tree, SWT.NONE);
    //$NON-NLS-1$
    column.setText("Resource");
    column.setWidth(150);
    column = new TreeColumn(tree, SWT.NONE);
    //$NON-NLS-1$
    column.setText("Description");
    column.setWidth(300);
    viewer.setContentProvider(new ErrorDetailContentProvider());
    viewer.setLabelProvider(new ErrorDetailLabelProvider());
    viewer.setInput(errors);
    viewer.expandAll();
}
Also used : GridLayout(org.eclipse.swt.layout.GridLayout) Composite(org.eclipse.swt.widgets.Composite) TreeViewer(org.eclipse.jface.viewers.TreeViewer) TreeColumn(org.eclipse.swt.widgets.TreeColumn) GridData(org.eclipse.swt.layout.GridData) Tree(org.eclipse.swt.widgets.Tree)

Aggregations

TreeViewer (org.eclipse.jface.viewers.TreeViewer)199 ICubridNode (com.cubrid.common.ui.spi.model.ICubridNode)62 CubridNodeChangedEvent (com.cubrid.common.ui.spi.event.CubridNodeChangedEvent)45 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)42 ISelectionProvider (org.eclipse.jface.viewers.ISelectionProvider)40 ExecTaskWithProgress (com.cubrid.common.ui.spi.progress.ExecTaskWithProgress)39 TaskExecutor (com.cubrid.common.ui.spi.progress.TaskExecutor)38 GridData (org.eclipse.swt.layout.GridData)37 CubridNavigatorView (com.cubrid.common.ui.common.navigator.CubridNavigatorView)36 Tree (org.eclipse.swt.widgets.Tree)34 Composite (org.eclipse.swt.widgets.Composite)33 CommonTaskExec (com.cubrid.common.ui.spi.progress.CommonTaskExec)31 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)29 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)28 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)28 ISchemaNode (com.cubrid.common.ui.spi.model.ISchemaNode)27 ServerInfo (com.cubrid.cubridmanager.core.common.model.ServerInfo)27 ArrayList (java.util.ArrayList)24 GridLayout (org.eclipse.swt.layout.GridLayout)23 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)22