org.eclipse.ui.dialogs.ContainerCheckedTreeViewer Java Examples
The following examples show how to use
org.eclipse.ui.dialogs.ContainerCheckedTreeViewer.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OverrideMethodsPage.java From Pydev with Eclipse Public License 1.0 | 6 votes |
private void createTreeViewer(Composite treeComp) { treeViewer = new ContainerCheckedTreeViewer(treeComp); treeViewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { processSelectionChange(); } }); treeViewer.setContentProvider(classProvider); treeViewer.setLabelProvider(labelProvider); treeViewer.setAutoExpandLevel(2); // treeViewer.addFilter(new MethodViewerFilter()); treeViewer.setUseHashlookup(true); treeViewer.setInput(""); treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0])); }
Example #2
Source File: GeneratePropertiesPage.java From Pydev with Eclipse Public License 1.0 | 6 votes |
private void createTreeViewer(Composite treeComp) { treeViewer = new ContainerCheckedTreeViewer(treeComp); treeViewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { getRequestProcsseor().setCheckedElements(treeViewer.getCheckedElements()); GeneratePropertiesPage.this.getWizard().getContainer().updateButtons(); } }); treeViewer.setContentProvider(classProvider); treeViewer.setLabelProvider(labelProvider); treeViewer.setAutoExpandLevel(2); treeViewer.setInput(""); treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0])); }
Example #3
Source File: ConstructorFieldPage.java From Pydev with Eclipse Public License 1.0 | 6 votes |
private void createTreeViewer(Composite treeComp) { treeViewer = new ContainerCheckedTreeViewer(treeComp); treeViewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(CheckStateChangedEvent event) { getRequestProcessor().setCheckedElements(treeViewer.getCheckedElements()); ConstructorFieldPage.this.getWizard().getContainer().updateButtons(); } }); treeViewer.setContentProvider(classProvider); treeViewer.setLabelProvider(labelProvider); treeViewer.setAutoExpandLevel(2); treeViewer.setInput(""); treeViewer.setSelection(new StructuredSelection(treeViewer.getExpandedElements()[0])); }
Example #4
Source File: CompositeFactory.java From ermasterr with Apache License 2.0 | 5 votes |
public static ContainerCheckedTreeViewer createCheckedTreeViewer(final AbstractDialog dialog, final Composite parent, final int height, final int span) { final GridData gridData = new GridData(); gridData.heightHint = height; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; gridData.horizontalSpan = span; final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); final Tree tree = viewer.getTree(); tree.setLayoutData(gridData); viewer.setContentProvider(new TreeNodeContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); if (dialog != null) { viewer.addCheckStateListener(new ICheckStateListener() { @Override public void checkStateChanged(final CheckStateChangedEvent event) { dialog.validate(); } }); } return viewer; }
Example #5
Source File: FilterBugsDialog.java From spotbugs with GNU Lesser General Public License v2.1 | 5 votes |
private ContainerCheckedTreeViewer createTree(Composite parent, int style) { final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, style | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.RESIZE) { /** * Overriden to re-set checked state of elements after filter change */ @Override public void refresh(boolean updateLabels) { super.refresh(updateLabels); setCheckedElements(checkedElements); } }; viewer.setContentProvider(contentProvider); viewer.setLabelProvider(labelProvider); viewer.setInput(allowedTypes); Object[] preselected = getPreselected(); viewer.setCheckedElements(preselected); viewer.addPostSelectionChangedListener(new TreeSelectionChangedListener()); viewer.getTree().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { updateDescription((IStructuredSelection) viewer.getSelection()); } }); viewer.addCheckStateListener(new TreeCheckStateListener()); return viewer; }
Example #6
Source File: CheckedTreeEditor.java From cppcheclipse with Apache License 2.0 | 5 votes |
/** * Returns this field editor's list control. * * @param parent * the parent control * @return the list control */ public Tree createListControl(Composite parent) { Tree table = (Tree) getTreeControl(); if (table == null) { listParent = parent; treeViewer = new ContainerCheckedTreeViewer(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION); table = treeViewer.getTree(); table.setFont(parent.getFont()); treeViewer.addCheckStateListener(this); } else { checkParent(table, parent); } return table; }
Example #7
Source File: AbstractSelectImportedObjectDialog.java From erflute with Apache License 2.0 | 5 votes |
private void createAllObjectGroup(Composite composite) { final GridData gridData = new GridData(); gridData.heightHint = 300; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); final Tree tree = viewer.getTree(); tree.setLayoutData(gridData); viewer.setContentProvider(new TreeNodeContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); }
Example #8
Source File: SelectImportedSchemaDialog.java From erflute with Apache License 2.0 | 5 votes |
private void createAllSchemaGroup(Composite composite) { final GridData gridData = new GridData(); gridData.heightHint = 300; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); final Tree tree = viewer.getTree(); tree.setLayoutData(gridData); viewer.setContentProvider(new TreeNodeContentProvider()); viewer.setLabelProvider(new ViewLabelProvider()); }
Example #9
Source File: PearFileResourceExportPage.java From uima-uimaj with Apache License 2.0 | 5 votes |
/** * Creates the tree viewer. * * @param parent the parent composite * @return TreeViewer that shows uses Workbench Content- and LabelProvider */ protected ContainerCheckedTreeViewer createTreeViewer(Composite parent) { final ContainerCheckedTreeViewer treeViewer = new ContainerCheckedTreeViewer(parent); final GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true); gridData.heightHint = 150; treeViewer.getTree().setLayoutData(gridData); treeViewer.setContentProvider(new WorkbenchContentProvider()); treeViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider()); treeViewer.setSorter(new WorkbenchViewerSorter()); return treeViewer; }
Example #10
Source File: AbstractSelectImportedObjectDialog.java From ermaster-b with Apache License 2.0 | 5 votes |
private void createAllObjectGroup(Composite composite) { GridData gridData = new GridData(); gridData.heightHint = 300; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Tree tree = this.viewer.getTree(); tree.setLayoutData(gridData); this.viewer.setContentProvider(new TreeNodeContentProvider()); this.viewer.setLabelProvider(new ViewLabelProvider()); }
Example #11
Source File: SelectImportedSchemaDialog.java From ermaster-b with Apache License 2.0 | 5 votes |
private void createAllSchemaGroup(Composite composite) { GridData gridData = new GridData(); gridData.heightHint = 300; gridData.horizontalAlignment = GridData.FILL; gridData.grabExcessHorizontalSpace = true; this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER); Tree tree = this.viewer.getTree(); tree.setLayoutData(gridData); this.viewer.setContentProvider(new TreeNodeContentProvider()); this.viewer.setLabelProvider(new ViewLabelProvider()); }
Example #12
Source File: TaxonomyCheckboxListView.java From slr-toolkit with Eclipse Public License 1.0 | 4 votes |
/** * This is a callback that will allow us to create the viewer and initialize * it. */ @Override public void createPartControl(Composite parent) { Optional<Model> m = ModelRegistryPlugin.getModelRegistry().getActiveTaxonomy(); contentProvider = new TermContentProvider(viewer); viewer = new ContainerCheckedTreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL); viewer.setContentProvider(contentProvider); DecoratingLabelProvider p = new DecoratingLabelProvider(new DefaultEObjectLabelProvider(), new TaxonomyLabelDecorator()); viewer.setLabelProvider(p); viewer.addCheckStateListener(this); viewer.setSorter(null); cellEditor = new MyTextCellEditor(viewer.getTree()); TreeViewerEditor.create( viewer, new ColumnViewerEditorActivationStrategy(viewer){ protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) { return event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION || (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.F2); } }, TreeViewerEditor.DEFAULT ); enableEditing(); if(m.isPresent()){ viewer.setInput(m.get()); } viewer.expandAll(); //Create right-click menu MenuManager menuManager = new MenuManager(); Menu menu = menuManager.createContextMenu(viewer.getTree()); viewer.getTree().setMenu(menu); getSite().registerContextMenu(menuManager, viewer); getSite().setSelectionProvider(viewer); // Create the help context id for the viewer's control PlatformUI.getWorkbench().getHelpSystem().setHelp(viewer.getControl(), "de.tudresden.slr.model.taxonomy.ui.viewer"); getSite().getWorkbenchWindow().getSelectionService().addPostSelectionListener(this); }
Example #13
Source File: PullUpMethodPage.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
private void precheckElements(final ContainerCheckedTreeViewer treeViewer) { final IMember[] members= fProcessor.getMembersToMove(); for (int i= 0; i < members.length; i++) { treeViewer.setChecked(members[i], true); } }
Example #14
Source File: OverrideMethodDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public ContainerCheckedTreeViewer getViewer() { return fViewer; }
Example #15
Source File: OverrideMethodDialog.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 4 votes |
public void inputChanged(Viewer viewer, Object oldInput, Object newInput) { fViewer= (ContainerCheckedTreeViewer) viewer; }