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


Java TreeColumn.pack方法代碼示例

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


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

示例1: SystemTree

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Create a new tree listing Solr system information.
 * 
 * @param composite
 *            Parent composite.
 */
public SystemTree(Composite composite) throws SophieException {
	// Instantiate Tree.
	tree = new Tree(composite, SWT.BORDER);
	tree.setHeaderVisible(true);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));

	// Create name/value columns.
	columnName = new TreeColumn(tree, SWT.LEFT);
	columnName.setText("Name");
	columnValue = new TreeColumn(tree, SWT.LEFT);
	columnValue.setText("Value");

	// Populate tree with data from Solr.
	populate();

	// Pack columns.
	columnName.pack();
	columnValue.pack();
}
 
開發者ID:fengtan,項目名稱:sophie,代碼行數:26,代碼來源:SystemTree.java

示例2: createPluginColumns

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void createPluginColumns(IPluginModelBase pm)
{
	// Add columns in the tree one column per selected plugin.
	// Create the first column for the key
	TreeViewerColumn col = new TreeViewerColumn(tv, SWT.NONE);
	TreeColumn swtCol = col.getColumn();
	swtCol.setText(getColumnName(pm));
	swtCol.setAlignment(SWT.CENTER);
	PluginDataProvider labelProvider = new PluginDataProvider();

	labelProvider.setPlugin(pm);
	col.setLabelProvider(labelProvider);
	swtCol.setToolTipText(pm.getBundleDescription().getName());
	swtCol.pack();

	columnsCache.put(pm, col);
}
 
開發者ID:opcoach,項目名稱:E34MigrationTooling,代碼行數:18,代碼來源:MigrationStatsE4View.java

示例3: createGroupAvailableIndicatorGroupss

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * This method initializes groupCurrentLink
 * 
 */
private void createGroupAvailableIndicatorGroupss() {
    groupAvailableIndicatorGroups = new Group(shell, SWT.NONE);
    groupAvailableIndicatorGroups.setText(Messages.getString("IndicatorGroupDialog.groupAvailableIndicatorGroups")); //$NON-NLS-1$
    groupAvailableIndicatorGroups.setBounds(new Rectangle(5, 86, 267, 271));
    treeAvailableIndicatorGroups = new Tree(groupAvailableIndicatorGroups, SWT.BORDER | SWT.CHECK);
    treeAvailableIndicatorGroups.setToolTipText(Messages.getString("IndicatorGroupDialog.groupAvailableIndicatorGroups.tiptext")); //$NON-NLS-1$
    treeAvailableIndicatorGroups.setBounds(new Rectangle(6, 51, 253, 212));

    TreeColumn nameCol = new TreeColumn(treeAvailableIndicatorGroups, SWT.LEFT);
    nameCol.setText(Messages.getString("IndicatorGroupDialog.Name")); //$NON-NLS-1$
    nameCol.pack();

    TreeColumn idCol = new TreeColumn(treeAvailableIndicatorGroups, SWT.LEFT);
    idCol.setText("ID"); //$NON-NLS-1$
    idCol.pack();
}
 
開發者ID:McGill-DP-Group,項目名稱:seg.jUCMNav,代碼行數:21,代碼來源:IndicatorGroupDialog.java

示例4: createGroupAssignedIndicatorGroups

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * This method initializes groupAddLink
 * 
 */
private void createGroupAssignedIndicatorGroups() {
    groupAssignedIndicatorGroups = new Group(shell, SWT.NONE);
    groupAssignedIndicatorGroups.setText(Messages.getString("IndicatorGroupDialog.groupAssignedIndicatorGroups")); //$NON-NLS-1$
    groupAssignedIndicatorGroups.setBounds(new Rectangle(324, 86, 267, 271));
    treeAssignedIndicatorGroups = new Tree(groupAssignedIndicatorGroups, SWT.BORDER | SWT.CHECK);
    treeAssignedIndicatorGroups.setToolTipText(Messages.getString("IndicatorGroupDialog.groupAssignedIndicatorGroups.tiptext")); //$NON-NLS-1$
    treeAssignedIndicatorGroups.setBounds(new Rectangle(6, 22, 253, 241));

    TreeColumn nameCol = new TreeColumn(treeAssignedIndicatorGroups, SWT.LEFT);
    nameCol.setText(Messages.getString("IndicatorGroupDialog.Name")); //$NON-NLS-1$
    nameCol.pack();

    TreeColumn idCol = new TreeColumn(treeAssignedIndicatorGroups, SWT.LEFT);
    idCol.setText("ID"); //$NON-NLS-1$
    idCol.pack();
}
 
開發者ID:McGill-DP-Group,項目名稱:seg.jUCMNav,代碼行數:21,代碼來源:IndicatorGroupDialog.java

示例5: showActivitiesToMove

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void showActivitiesToMove(java.util.List<SuggestedStartTime> startTimes) {
		movedItems.clearAll(true);
		Map<EActivityGroup, TreeItem> groupToItemMap = new HashMap<EActivityGroup, TreeItem>();
		startTimes = new ArrayList<SuggestedStartTime>(startTimes);
		Collections.sort(startTimes, new SuggestionComparator());
		for (SuggestedStartTime suggestion : startTimes) {
			createSuggestionItem(groupToItemMap, suggestion);
		}
//		movedItems.setHeaderVisible(true);
		movedItems.setEnabled(true);
		for (TreeColumn column : movedItems.getColumns()) {
			column.pack();
		}
	}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:15,代碼來源:FixingViolationsWizardFixesPage.java

示例6: showNoActivitiesToMove

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void showNoActivitiesToMove(Tree items, String string) {
	items.clearAll(true);
	TreeItem item = new TreeItem(items, SWT.NONE);
	item.setText(string);
	items.setEnabled(false);
	for (TreeColumn column : items.getColumns()) {
		column.pack();
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:10,代碼來源:FixingViolationsWizardFixesPage.java

示例7: fitToContents

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void fitToContents() {
    if (columns != null) {
        for (TreeColumn c : columns) {
            c.pack();
        }
    }

}
 
開發者ID:fabioz,項目名稱:Pydev,代碼行數:9,代碼來源:TreeWithAddRemove.java

示例8: refresh

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Refreshes the tree
 */
protected void refresh() {
    treeViewer.refresh();
    treeViewer.expandAll();
    for (TreeColumn tc : treeViewer.getTree().getColumns()) {
        tc.pack();
    }
}
 
開發者ID:arx-deidentifier,項目名稱:arx,代碼行數:11,代碼來源:ViewProperties.java

示例9: resizeColumns

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public static void resizeColumns(TreeViewer viewer)
{
    for (TreeColumn tc : viewer.getTree().getColumns())
	    tc.pack();
}
 
開發者ID:eclipse,項目名稱:gemoc-studio,代碼行數:6,代碼來源:TreeViewerHelper.java

示例10: FilesTree

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Create a new tree listing Solr config files.
 * 
 * @param composite
 *            Parent composite.
 */
public FilesTree(Composite composite) throws SophieException {
    Composite parent = new Composite(composite, SWT.NULL);
    parent.setLayout(new GridLayout(2, true));
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Instantiate Tree.
    tree = new Tree(parent, SWT.BORDER);
    tree.setHeaderVisible(true);
    tree.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Display file in viewer when user double clicks tree item.
    tree.addListener(SWT.MouseDoubleClick, new Listener() {
        @Override
        public void handleEvent(Event event) {
            Point point = new Point(event.x, event.y);
            TreeItem item = tree.getItem(point);
            if (item != null) {
                String fullPath = Objects.toString(item.getData(), "");
                String content;
                if (StringUtils.isEmpty(fullPath)) {
                    content = "This is a directory.";
                } else {
                    try {
                        content = SolrUtils.getFileContent(fullPath);
                    } catch (SophieException e) {
                        content = "Unable to fetch content for " + fullPath + ": " + e.getMessage();
                        Sophie.log.error("Unable to fetch content for " + fullPath, e);
                    }
                }
                styledText.setText(content);
            }
        }
    });

    // Create column.
    columnName = new TreeColumn(tree, SWT.LEFT);
    columnName.setText("File Name");

    // Instantiate viewer.
    styledText = new StyledText(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    styledText.setText("No file selected.");
    styledText.setEditable(false);
    styledText.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Config files are easier to read with a monospaced font.
    Font monospaced = JFaceResources.getFont(JFaceResources.TEXT_FONT);
    styledText.setFont(monospaced);

    // Populate tree with data from Solr.
    populate();

    // Pack columns.
    columnName.pack();
}
 
開發者ID:fengtan,項目名稱:sophie,代碼行數:61,代碼來源:FilesTree.java

示例11: createReferenceBinding

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void createReferenceBinding(DetailProviderParameter parameter, EObject model, final EditingDomain editingDomain, IItemPropertyDescriptor pd, Object feature) {
	String displayName = pd.getDisplayName(model);
	if (model instanceof MultiEObject) {
		LogUtil.warn("Tables not supported for multiple selection - " + displayName);
		return;
	}
	EReference reference = (EReference) feature;
	Composite parent = parameter.getParent();
	FormToolkit toolkit = parameter.getDetailFormToolkit();
	Section section = DetailFormToolkit.createSection(toolkit, parent, displayName, null);
	section.setLayout(new RowLayout(SWT.VERTICAL));
	Composite composite = toolkit.createComposite(section);
	section.setClient(composite);
	GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(true).applyTo(composite);
	
	Composite topButtonComposite = toolkit.createComposite(section, SWT.NO_BACKGROUND);
	topButtonComposite.setLayout(new RowLayout(SWT.HORIZONTAL));
	section.setTextClient(topButtonComposite);
	
	boolean editable = pd.canSetProperty(model);
	final TreeTableViewer<EObject, EAttribute> viewer = EMFTreeTableUtils.createEMFTreeTableViewer(composite, reference, reference.getEReferenceType(), editingDomain, false, true, true, editable);
	TreeTableComposite treeTableComposite = viewer.getTreeTableComposite();
	GridDataFactory.fillDefaults().grab(true, false).applyTo(treeTableComposite);

	if (editable) {
		addEditButton(composite, displayName, editingDomain, toolkit, viewer);
		populateTopButtonComposite(topButtonComposite, displayName, viewer, reference, editingDomain, model, editable, toolkit);
	}
	if (topButtonComposite.getChildren().length == 0) {
		section.setTextClient(null);
	}

	viewer.setInput(model);
	TreeColumn[] columns = viewer.getTree().getColumns();
	for (TreeColumn column : columns) {
		column.pack();
	}
	
	ISelectionChangedListener selectionChangedListener = parameter.getSelectionChangedListener();
	if (selectionChangedListener != null) {
		viewer.addSelectionChangedListener(selectionChangedListener);
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:44,代碼來源:TableBindingFactory.java


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