Java 类org.eclipse.ui.part.DrillDownAdapter 实例源码

项目:dockerfoundry    文件:DockerExplorerView.java   
/**
 * 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.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL);
    drillDownAdapter = new DrillDownAdapter(viewer);
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
    viewer.setSorter(new NameSorter());
    viewer.setInput(getInitInput());

    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "cn.dockerfoundry.ide.eclipse.explorer.ui.viewer");
    makeActions();
    hookContextMenu();
    hookSingleClickAction();
    hookDoubleClickAction();
    contributeToActionBars();
}
项目:snipulti    文件:SnipultiView.java   
/**
 * 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);
    drillDownAdapter = new DrillDownAdapter(viewer);
    vcp=new ViewContentProvider(this);
    viewer.setContentProvider(vcp);
    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.klyserv.snipulti.viewer");
    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
}
项目:emf-fragments    文件:EmfFragViewBasedOnEMF.java   
/**
 * 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);
    drillDownAdapter = new DrillDownAdapter(viewer);        

    ComposedAdapterFactory composedAdapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);

    AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider(composedAdapterFactory);
    AdapterFactoryContentProvider contentProvider = new AdapterFactoryContentProvider(composedAdapterFactory);

    viewer.setLabelProvider(labelProvider);
    viewer.setContentProvider(contentProvider);

    rs = new ResourceSetImpl();
    viewer.setInput(rs);

    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "de.hub.emffrag.ui.viewer");
    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
}
项目:mule-tooling-incubator    文件:TasksView.java   
/**
 * This is a callback that will allow us to create the viewer and initialize it.
 */
public void createPartControl(Composite parent) {
    PatternFilter filter = new PatternFilter();
    FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL, filter, true);
    viewer = tree.getViewer();
    drillDownAdapter = new DrillDownAdapter(viewer);
    viewer.setContentProvider(new ViewContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
    viewer.setSorter(new NameSorter());
    viewer.setInput(getViewSite());
    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
    getSite().getWorkbenchWindow().getSelectionService().addSelectionListener(this);
}
项目:eZooKeeper    文件:JmxExplorerView.java   
public void createPartControl(Composite parent) {

        DataModelManager<JmxConnectionModel, JmxConnectionDescriptor, JmxConnection> jmxConnectionModelManager = JmxActivator
                .getDefault().getJmxConnectionModelManager();

        ElementTypes elementTypes = new ElementTypes();

        elementTypes.add(jmxConnectionModelManager.getClass(), new DataModelManagerElementType());
        elementTypes.add(JmxConnectionModel.class, new JmxConnectionModelElementType());
        elementTypes.add(DomainModel.class, new DomainModelElementType());
        elementTypes.add(ObjectNameKeyValueModel.class, new ObjectNameKeyValueModelElementType());
        elementTypes.add(MBeanModel.class, new MBeanModelElementType());
        elementTypes.add(MBeanAttributesModelCategory.class, new MBeanAttributesModelCategoryElementType());
        elementTypes.add(MBeanAttributeModel.class, new MBeanAttributeModelElementType());
        elementTypes.add(MBeanOperationsModelCategory.class, new MBeanOperationsModelCategoryElementType());
        elementTypes.add(MBeanOperationModel.class, new MBeanOperationModelElementType());

        _TreeViewer = ViewerFactory.createDataModelTreeViewer(parent, SWT.MULTI | SWT.VIRTUAL | SWT.H_SCROLL
                | SWT.V_SCROLL, elementTypes, jmxConnectionModelManager);

        _TreeViewer.getTree().addMouseListener(new MouseAdapter() {

            @Override
            public void mouseDown(MouseEvent e) {
                getSite().getWorkbenchWindow().getActivePage().activate(JmxExplorerView.this);
            }
        });

        getSite().setSelectionProvider(_TreeViewer);

        _DrillDownAdapter = new DrillDownAdapter(_TreeViewer);

        makeActions();
        hookContextMenu();
        contributeToActionBars();

    }
项目:code    文件:AbstractObjectTreeView.java   
/**
 * Create contents of the view part.
 * 
 * @param parent
 */
@Override
public void createPartControl(Composite parent) {
    // create the desired layout for this wizard page
    GridLayout glLeft = new GridLayout();
    glLeft.numColumns = 3;
    parent.setLayout(glLeft);
    // Create the sorters and filters
    viewerFilterDisplay = new ViewerFilterObjectGraph();
    viewerSorterDisplay = new ArchitecturalViewerSorter();

    GridData gdVisualFilteredViewer = new org.eclipse.swt.layout.GridData();
    gdVisualFilteredViewer.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
    gdVisualFilteredViewer.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
    gdVisualFilteredViewer.grabExcessHorizontalSpace = true;
    gdVisualFilteredViewer.grabExcessVerticalSpace = true;
    gdVisualFilteredViewer.horizontalSpan = 3;

    ftDisplay = new FilteredTree(parent, SWT.BORDER | SWT.MULTI
            | SWT.H_SCROLL | SWT.V_SCROLL, new ObjectGraphPatternFilter()); // Support
    // single
    ftDisplay.setLayoutData(gdVisualFilteredViewer);
    viewer = ftDisplay.getViewer();
    drillDownAdapter = new DrillDownAdapter(viewer);

    viewer.setContentProvider(new ContentProviderDisplayGraph());
    viewer.setLabelProvider(new ArchitecturalDecoratingLabelProvider(
            ftDisplay));
    // By default, no sorting
    viewer.setSorter(viewerSorterDisplay);
    viewer.addFilter(viewerFilterDisplay);

    viewer.setUseHashlookup(true);

    createActions();
    initializeToolBar();
    initializeMenu();
    hookLogListeners();
    refresh();
}
项目:triquetrum    文件:WorkflowRepositoryView.java   
/**
 * 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);
  drillDownAdapter = new DrillDownAdapter(viewer);

  viewer.setContentProvider(new ViewContentProvider());
  viewer.setLabelProvider(new ViewLabelProvider(viewer));
  viewer.setInput(getViewSite());
  viewer.addDragSupport(DND.DROP_COPY, new Transfer[] { ModelHandleTransfer.getInstance() }, new AocDragSourceListener(viewer));

  getSite().setSelectionProvider(viewer);

  hookContextMenu();
}
项目:plugindependencies    文件:PluginTreeView.java   
@Override
public void createPartControl(Composite parent) {
    Filter filter = new Filter();
    FilteredTree tree = new FilteredTree(parent, SWT.MULTI | SWT.H_SCROLL
            | SWT.V_SCROLL, filter, true) {
        @Override
        protected void updateToolbar(boolean visible) {
            super.updateToolbar(visible);
            viewer.collapseAll();
            viewer.expandToLevel(2);
        }
    };

    viewer = tree.getViewer();
    drillDownAdapter = new DrillDownAdapter(viewer);
    viewer.setContentProvider(new ViewContentProvider(this));
    viewer.setLabelProvider(new ViewLabelProvider());
    viewer.setComparator(new ViewSorter());
    viewer.getTree().setToolTipText(null);
    ColumnViewerToolTipSupport.enableFor(viewer);
    getSite().setSelectionProvider(viewer);
    refresh(new Object());

    targetActions = new LinkedHashSet<>();

    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();

    readTargetDefinitions();

}
项目:gmm-eclipse-plugins    文件:GenMyModelExplorer.java   
/**
     * This is a callback that will allow us to create the viewer and initialize
     * it.
     */
    public void createPartControl(Composite parent) {
        content = new ViewContentProvider(client, getViewSite());
        viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
        drillDownAdapter = new DrillDownAdapter(viewer);
        viewer.setContentProvider(content);
        viewer.setLabelProvider(new ViewLabelProvider(getSite()));
        viewer.setInput(getViewSite());

//      int operations = DND.DROP_COPY;
//      Transfer[] transferTypes = new Transfer[]{FileTransfer.getInstance()};
//      viewer.addDragSupport(operations, transferTypes, new DragListener(viewer));
//      viewer.addDropSupport(operations, transferTypes, new DropListener(parent, viewer));

        if (save != null) {
            IMemento[] credentials = save.getChildren("credential");
            save = XMLMemento.createWriteRoot("view");
            for (IMemento credential : credentials) {
                addAccount(new GMMCredential(credential.getString("username"),
                        credential.getString("password")));
            }
        }

        makeActions(parent);
        contributeToActionBars();
        doubleClickProjectAction();
        rightClickProjectAction();
        pageProjectAction();
    }
项目:emf-fragments    文件:EmfFragView.java   
/**
 * 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);
    drillDownAdapter = new DrillDownAdapter(viewer);        

    CustomizationManager customizationManager = new CustomizationManager();
    customizationManager.setShowAttributes(true);
    CustomizableModelContentProvider contentProvider = new CustomizableModelContentProvider(customizationManager) {

        @Override
        public Object[] getRootElements(Object inputElement) {
            List<EObject> result = new ArrayList<EObject>();
            if (inputElement instanceof ResourceSet) {
                for(Resource resource: ((ResourceSet)inputElement).getResources()) {                                        
                    synchronized (resource) {
                        result.addAll(resource.getContents());
                    }                       
                }
                return result.toArray();
            } else {
                return super.getRootElements(inputElement);
            }
        }

    };
    CustomizableModelLabelProvider labelProvider = new CustomizableModelLabelProvider(customizationManager);

    viewer.setLabelProvider(labelProvider);
    viewer.setContentProvider(contentProvider);

    rs = new ResourceSetImpl();
    viewer.setInput(rs);

    // Create the help context id for the viewer's control
    PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "de.hub.emffrag.ui.viewer");
    makeActions();
    hookContextMenu();
    hookDoubleClickAction();
    contributeToActionBars();
}
项目:Archie-Smart-IDE    文件:AutoDetectView.java   
/*******************************************************
 * Creates the results group of the view
 * 
 * @param parent
 *            The parent composite of this group
 *******************************************************/
private void createResultsComposite(Composite parent)
{
    // The results group
    Group resultsGroup = new Group(parent, SWT.SHADOW_ETCHED_OUT);
    resultsGroup.setText("Results");
    resultsGroup.setLayout(new GridLayout(1, true));
    GridData gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    resultsGroup.setLayoutData(gridData);

    // A composite for the filters
    Composite filterComposite = new Composite(resultsGroup, SWT.NONE);
    filterComposite.setLayout(new GridLayout(2, true));
    filterComposite.setLayoutData(gridData);

    // The label for the classification filter
    Label labelClassFilter = new Label(filterComposite, SWT.NONE);
    labelClassFilter.setText("Classification Filter");

    // The drop down for the classification filter
    mRawResultsFilter = new Combo(filterComposite, SWT.READ_ONLY);
    mRawResultsFilter.setLayoutData(gridData);

    // Composite for the results tree view
    Composite resultsListComposite = new Composite(resultsGroup, SWT.NONE);
    resultsListComposite.setLayout(new GridLayout(1, true));

    gridData = new GridData();
    gridData.horizontalAlignment = GridData.FILL;
    gridData.verticalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.grabExcessVerticalSpace = true;

    resultsListComposite.setLayoutData(gridData);

    mResultsTree = new TreeViewer(resultsListComposite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    mResultsTree.setLabelProvider(new DelegatingStyledCellLabelProvider(new TreeLabelProvider(this.mImageRegistry,
            this.mFontRegistry)));
    mResultsTree.setContentProvider(new TreeContentProvider());
    mResultsTree.setInput(new Object[0]);

    mResultsTree.getControl().setLayoutData(gridData);

    // Set the drill down adapter of the results tree
    mDrillDownAdapter = new DrillDownAdapter(mResultsTree);
}