當前位置: 首頁>>代碼示例>>Java>>正文


Java CheckboxTreeViewer.getTree方法代碼示例

本文整理匯總了Java中org.eclipse.jface.viewers.CheckboxTreeViewer.getTree方法的典型用法代碼示例。如果您正苦於以下問題:Java CheckboxTreeViewer.getTree方法的具體用法?Java CheckboxTreeViewer.getTree怎麽用?Java CheckboxTreeViewer.getTree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.jface.viewers.CheckboxTreeViewer的用法示例。


在下文中一共展示了CheckboxTreeViewer.getTree方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(final Composite parent) {
    final Composite composite = (Composite) super.createDialogArea(parent);
    final Label messageLabel = createMessageArea(composite);
    final CheckboxTreeViewer treeViewer = createTreeViewer(composite);
    final Control buttonComposite = createSelectionButtons(composite);
    final Tree treeWidget = treeViewer.getTree();
    GridDataFactory
            .fillDefaults()
            .hint(convertWidthInCharsToPixels(VIEWER_WIDTH_IN_CHARS),
                    convertHeightInCharsToPixels(VIEWER_HEIGHT_IN_CHARS)).applyTo(treeWidget);
    treeWidget.setFont(parent.getFont());
    if (isEmpty()) {
        messageLabel.setEnabled(false);
        treeWidget.setEnabled(false);
        buttonComposite.setEnabled(false);
    }
    return composite;
}
 
開發者ID:GRA-UML,項目名稱:tool,代碼行數:20,代碼來源:NiemCheckedTreeSelectionDialog.java

示例2: createControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {

  Composite container = new Composite(parent, SWT.NULL);
  setControl(container);

  checkboxTreeViewer = new CheckboxTreeViewer(container, SWT.BORDER);
  Tree tree = checkboxTreeViewer.getTree();
  tree.setBounds(0, 0, 574, 282);

  AttributeSelectionContentProvider adapterContentProvider =
      new AttributeSelectionContentProvider();
  checkboxTreeViewer.setContentProvider(adapterContentProvider);
  checkboxTreeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:18,代碼來源:AttributesSelectionPage.java

示例3: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
  this.parent = parent;
  Composite area = (Composite) super.createDialogArea(parent);
  Composite container = new Composite(area, SWT.NONE);
  container.setLayoutData(new GridData(GridData.FILL_BOTH));
  GridLayout layout = new GridLayout(1, false);
  container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
  container.setLayout(layout);

  treeViewer = new CheckboxTreeViewer(area, SWT.BORDER);

  Tree tree = treeViewer.getTree();
  tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

  treeViewer
      .setLabelProvider(new AdapterFactoryLabelProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer
      .setContentProvider(new AdapterFactoryContentProvider(new ReflectiveItemProviderAdapterFactory()));

  treeViewer.setInput(modelRoot);
  return area;
}
 
開發者ID:atlanmod,項目名稱:emfviews,代碼行數:25,代碼來源:ModelSelectionDialog.java

示例4: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(final Composite parent) {
    final Composite composite = (Composite) super.createDialogArea(parent);
    final Label messageLabel = createMessageArea(composite);

    final Text pattern = new Text(composite, SWT.SINGLE | SWT.BORDER | SWT.SEARCH | SWT.ICON_CANCEL);
    GridDataFactory.fillDefaults().applyTo(pattern);

    final CheckboxTreeViewer treeViewer = createTreeViewer(composite);

    pattern.addModifyListener(new PatternModifyListener(pattern));

    pattern.addKeyListener(new KeyAdapter() {
        @Override
        public void keyPressed(final KeyEvent e) {
            if (e.keyCode == SWT.ARROW_DOWN) {
                final Tree theTree = treeViewer.getTree();
                if (theTree.getItemCount() > 0) {
                    theTree.setFocus();
                }
            }
        }
    });

    pattern.setFocus();

    final Control buttonComposite = createSelectionButtons(composite);
    final Tree treeWidget = treeViewer.getTree();
    GridDataFactory
            .fillDefaults()
            .hint(convertWidthInCharsToPixels(VIEWER_WIDTH_IN_CHARS),
                    convertHeightInCharsToPixels(VIEWER_HEIGHT_IN_CHARS)).applyTo(treeWidget);
    treeWidget.setFont(parent.getFont());
    if (isEmpty()) {
        messageLabel.setEnabled(false);
        treeWidget.setEnabled(false);
        buttonComposite.setEnabled(false);
    }
    return composite;
}
 
開發者ID:info-sharing-environment,項目名稱:NIEM-Modeling-Tool,代碼行數:41,代碼來源:NiemCheckedTreeSelectionDialog.java

示例5: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite parent){
	DisplayPanel panel = new DisplayPanel(parent, fields, 2, 2, new IAction[0]);
	panel.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	panel.setAutosave(true);
	panel.setObject(vt);
	
	Composite treeComposite = new Composite(parent, SWT.NONE);
	GridLayout gridLayout = new GridLayout(1, false);
	gridLayout.marginLeft = 5;
	treeComposite.setLayout(gridLayout);
	treeComposite.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	
	treeViewer =
		new CheckboxTreeViewer(treeComposite, SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, true));
	tree.setHeaderVisible(true);
	tree.setLinesVisible(true);
	
	TreeViewerColumn col = new TreeViewerColumn(treeViewer, SWT.NONE);
	col.getColumn().setWidth(225);
	col.getColumn().setText("Impfung gegen Krankheit(en)");
	
	treeViewer.setContentProvider(new DiseaseTreeContentProvider());
	treeViewer.setLabelProvider(new DiseaseTreeLabelProvider());
	treeViewer.setInput(DiseaseDefinitionModel.getDiseaseDefinitions());
	treeViewer.setCheckedElements(loadSelected().toArray());
	
	return panel;
}
 
開發者ID:elexis,項目名稱:elexis-3-base,代碼行數:32,代碼來源:EditVaccinationDialog.java

示例6: createProjectsTreeControl

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
private void createProjectsTreeControl(final Composite container) {
    treeViewer = new CheckboxTreeViewer(container, TREE_STYLES);
    treeControl = treeViewer.getTree();
    GridDataBuilder.newInstance().fill().grab().hHint(150).applyTo(treeControl);
    treeControl.setHeaderVisible(false);

    projectColumn = new TreeColumn(treeControl, SWT.NONE);
    projectColumn.setText(Messages.getString("GitImportWizardSelectProjectsPage.ProjectColumnName")); //$NON-NLS-1$
    projectColumn.setWidth(300);

    final TreeViewerColumn nameColumnViewer = new TreeViewerColumn(treeViewer, projectColumn);
    nameColumnViewer.setLabelProvider(new ProjectNameLabelProvider());
    nameColumnViewer.setEditingSupport(new ProjectNameEditingSupport(treeViewer));

    pathColumn = new TreeColumn(treeControl, SWT.NONE);
    pathColumn.setText(Messages.getString("GitImportWizardSelectProjectsPage.PathColumnName")); //$NON-NLS-1$
    pathColumn.setWidth(500);

    final TreeViewerColumn pathColumnViewer = new TreeViewerColumn(treeViewer, pathColumn);
    pathColumnViewer.setLabelProvider(new ImportProjectPathLabelProvider());

    treeControl.setHeaderVisible(true);
    treeControl.setSortColumn(projectColumn);
    treeControl.setLinesVisible(true);

    treeViewer.setUseHashlookup(true);
    treeViewer.setContentProvider(new ProjectTreeContentProvider());
    treeViewer.setAutoExpandLevel(2);
    treeViewer.addCheckStateListener(new ProjectCheckStateListener());

    searchForNestedProjectsButton = new Button(container, SWT.CHECK);
    searchForNestedProjectsButton.setText(
        Messages.getString("GitImportWizardSelectProjectsPage.SearchForNestedButtonText")); //$NON-NLS-1$
    GridDataBuilder.newInstance().hGrab().hFill().applyTo(searchForNestedProjectsButton);
    searchForNestedProjectsButton.addSelectionListener(new SelectionAdapter() {
        @Override
        public void widgetSelected(final SelectionEvent e) {
            refresh();

        }
    });
}
 
開發者ID:Microsoft,項目名稱:team-explorer-everywhere,代碼行數:43,代碼來源:GitImportWizardSelectProjectsPage.java

示例7: createDialogArea

import org.eclipse.jface.viewers.CheckboxTreeViewer; //導入方法依賴的package包/類
/**
	 * Create contents of the dialog.
	 * @param parent
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		Composite area = (Composite) super.createDialogArea(parent);
		Composite container = new Composite(area, SWT.NONE);
		container.setLayout(new GridLayout(1, false));
		container.setLayoutData(new GridData(GridData.FILL_BOTH));
		
		Composite composite = new Composite(container, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label lblCurrentProject = new Label(composite, SWT.NONE);
		lblCurrentProject.setText("Current Project");
		
		currentProjectLabeltext = new Text(composite, SWT.BORDER);
		currentProjectLabeltext.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label lblCurrentDbcollection = new Label(composite, SWT.NONE);
		lblCurrentDbcollection.setText("Current DBCollection");
		
		currentDBCollectionText = new Text(composite, SWT.BORDER);
		currentDBCollectionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Composite composite_1 = new Composite(container, SWT.NONE);
		composite_1.setLayout(new GridLayout(1, false));
		composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		composite_1.setBounds(0, 0, 64, 64);
		
		Label lblChooseTheNew = new Label(composite_1, SWT.NONE);
		lblChooseTheNew.setText("Choose the new Location with Project and Database Collection");
		
		checkboxTreeViewer = new CheckboxTreeViewer(composite_1, SWT.BORDER);
		Tree tree = checkboxTreeViewer.getTree();
		tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
//		Button btnMoveRelatedObjects = new Button(composite_1, SWT.CHECK);
//		btnMoveRelatedObjects.setText("Move related objects shown as children of current object aswell.");

		loadInput();
		return area;
	}
 
開發者ID:cplutte,項目名稱:bts,代碼行數:46,代碼來源:MoveObjectAmongProjectDBCollectionSelectionDialog.java


注:本文中的org.eclipse.jface.viewers.CheckboxTreeViewer.getTree方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。