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;
}
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();
}
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);
}
}
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;
}
}
}
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();
}
Aggregations