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


Java TreeColumn.getData方法代碼示例

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


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

示例1: updateOrder

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void updateOrder() {
	TreeColumn[] treeColumns = tree.getColumns();
	int[] order = tree.getColumnOrder();
	List<C> mergeColumns = new Vector<C>();
	mergeColumns.add(configuration.getZeroColumn());
	for (int i = 0 ; i < order.length ; i++) {
		int position = order[i];
		TreeColumn treeColumn = treeColumns[position];
		C mergeColumn = (C)treeColumn.getData(ITreeTableColumn.class.getCanonicalName());
		if (mergeColumn != configuration.getZeroColumn()) {
			mergeColumns.add(mergeColumn);
		}
	}
	if (!mergeColumns.equals(configuration.getColumns())) {
		configuration.setColumns(mergeColumns);
	} else {
		// reset column order
		tree.setColumnOrder(computeOrder());
	}
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:21,代碼來源:TreeTableComposite.java

示例2: getColumnIndex

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Returns the actual column index of the passed ColumnDesc
 * @param desc ColumnDesc
 * @return Position or -1 if column is not present
 */
public final int getColumnIndex(ColumnDesc desc){
	if(desc == null){
		return -1;
	}
	
	int pos = 0;

	// Initial position
	TreeColumn[] items = viewer.getTree().getColumns();
	// actual order (index is order, value is init position)
	int[] actOrder = viewer.getTree().getColumnOrder();
	for(TreeColumn item : items){
		if(desc == (ColumnDesc) item.getData(KEY_COLDESC)){
			for(int i=0;i<actOrder.length;i++){
				if(actOrder[i] == pos){
					return i;
				}
			}
		}
		pos++;
	}
	return -1;
}
 
開發者ID:baloise,項目名稱:egitblit,代碼行數:29,代碼來源:ColumnFactory.java

示例3: onColumnCreation

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void onColumnCreation(TreeColumn column)
{
    // When a resize occurs, update the scroll bars
    column.addControlListener(onResizeColumn);

    // Change column selection on click.
    column.addListener(SWT.Selection, columnSelectionListener);

    if (column.getData() != null) {
        // Edit design on double-click.
        column.addListener(SWT.DefaultSelection,
                           columnDefaultSelectionListener);

        delayedDesignSelection.addToSelection(column.getData(),
                                                   column);
    }
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:18,代碼來源:ProjectUI.java

示例4: setSelectedCell

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Support for selecting a cell
 */
public void setSelectedCell(TreeItem item, TreeColumn column)
{
    if ((item != null) && (column != null)) {
        AUndertaking t = (AUndertaking) item.getData();
        Design d = (Design) column.getData();

        if ((t != null) && (d != null)) {
            deselectAll();
            selectedColumns.add(column);
            selectedItems.put(t, item);

            raiseAlert(new ProjectSelectionChange(this,
                                                  tree.indexOf(column),
                                                  item,
                                                  true));
        }
    }
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:22,代碼來源:SWTTreeProjectSelectionState.java

示例5: updateOrder

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void updateOrder() {
	TreeColumn[] treeColumns = getTree().getColumns();
	int[] order = getTree().getColumnOrder();
	List<PlanAdvisorColumnSpecification> specs = new Vector<PlanAdvisorColumnSpecification>();
	for (int i = 0 ; i < order.length ; i++) {
		int position = order[i];
		TreeColumn treeColumn = treeColumns[position];
		PlanAdvisorColumnSpecification spec = (PlanAdvisorColumnSpecification)treeColumn.getData(PlanAdvisorColumnSpecification.class.getCanonicalName());
		specs.add(spec);
	}
	PlanAdvisorViewPreferences.setVisibleColumns(specs);
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:13,代碼來源:PlanAdvisorTreeViewer.java

示例6: handleColumnSelected

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private void handleColumnSelected(Tree tree, TreeColumn treeColumn) {
	C mergeColumn = (C)treeColumn.getData(ITreeTableColumn.class.getCanonicalName());
	if (mergeColumn.getComparator() == null) {
		return; // ignore selection on columns with no comparator
	}
	int direction = SWT.DOWN;
	if (tree.getSortColumn() == treeColumn) {
		if (tree.getSortDirection() == SWT.DOWN) {
			direction = SWT.UP;
		} else if (tree.getSortDirection() == SWT.UP) {
			direction = SWT.NONE;
		}
	}
	configuration.setSort(mergeColumn, direction);
}
 
開發者ID:nasa,項目名稱:OpenSPIFe,代碼行數:16,代碼來源:TreeTableComposite.java

示例7: getColumnDesc

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Return the ColumnDesc of the passed TreeColumn
 * @param item ColumnDesc
 * @return TreeColumn
 */
public final static ColumnDesc getColumnDesc(TreeColumn item){
	if(item == null){
		return null;
	}
	return (ColumnDesc) item.getData(KEY_COLDESC);
}
 
開發者ID:baloise,項目名稱:egitblit,代碼行數:12,代碼來源:ColumnFactory.java

示例8: getColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Get a column by ColumnDesc
 * @param desc ColumnDesc
 * @return TreeColumn or null if the column is not present
 */
public final TreeColumn getColumn(ColumnDesc desc){
	if(desc == null){
		return null;
	}

	TreeColumn[] items = viewer.getTree().getColumns();
	for(TreeColumn item : items){
		if(desc == (ColumnDesc) item.getData(KEY_COLDESC)){
			return item;
		}
	}
	return null;
}
 
開發者ID:baloise,項目名稱:egitblit,代碼行數:19,代碼來源:ColumnFactory.java

示例9: handleEvent

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void handleEvent(Event evt)
{
    TreeColumn colToDelete = (TreeColumn) evt.widget;
    CogToolPref.ALERTER.removeAllHandlers(colToDelete);
    Design design = (Design) colToDelete.getData();
    design.removeAllHandlers(ProjectUIModel.this);
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:8,代碼來源:ProjectUIModel.java

示例10: getDesignTreeColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public TreeColumn getDesignTreeColumn(Design design)
{
    int designIndex = tree.getColumnCount() - 1;

    while (designIndex > 0) {
        TreeColumn column = tree.getColumn(designIndex--);

        if (design == column.getData()) {
            return column;
        }
    }

    return null;
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:15,代碼來源:ProjectUIModel.java

示例11: handleEvent

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void handleEvent(Event evt)
{
    TreeColumn col = (TreeColumn) evt.widget;

    if (col.getData() != null) {
        DesignSelectionState seln =
            new SingleDesignSelectionState((Design) col.getData());

        performAction(ProjectLID.EditDesign, seln);
    }
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:12,代碼來源:ProjectUI.java

示例12: createSetToolTipListener

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
protected Listener createSetToolTipListener()
{
    return new Listener() {

        public void handleEvent(Event evt)
        {
            String toolTipText = null;

            TreeColumn col = findColumn(evt.x);

            if (col != null) {
                Design colData = (Design) col.getData();

                if (colData != null) {
                    toolTipText = colData.getName();
                }
            }

            TreeItem row = tree.getItem(new Point(evt.x, evt.y));

            if (row != null) {
                AUndertaking rowData = (AUndertaking) row.getData();

                if (rowData != null) {
                    if (toolTipText != null) {
                        toolTipText += '@' + rowData.getName();
                    }
                    else {
                        toolTipText = rowData.getName();
                    }
                }
            }

            tree.setToolTipText(toolTipText);
        }
    };
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:38,代碼來源:ProjectUI.java

示例13: onColumnDeletion

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
public void onColumnDeletion(TreeColumn column)
{
    // It's ok if this test fails; might be a redo!
    if (selection.getSelectedColumn() == column) {
        selection.deselectColumn(column);
    }

    if (column.getData() != null) {
        delayedDesignSelection.removeFromSelection(column.getData());
        delayedCellSelection.removeFromSelection(column.getData());
    }
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:13,代碼來源:ProjectUI.java

示例14: getSelectedDesign

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
/**
 * Return the selected design, if any.  If none, return <code>null</code>.
 *
 * @return the selected design, if any; otherwise return <code>null</code>
 * @author mlh
 */
public Design getSelectedDesign()
{
    TreeColumn column = getSelectedColumn();

    return (column == null) ? null : (Design) column.getData();
}
 
開發者ID:cogtool,項目名稱:cogtool,代碼行數:13,代碼來源:SWTTreeProjectSelectionState.java

示例15: getColDef_FromHeaderColumn

import org.eclipse.swt.widgets.TreeColumn; //導入方法依賴的package包/類
private ColumnDefinition getColDef_FromHeaderColumn() {

		ColumnDefinition colDef = null;

		final Object column = _headerColumn.tableOrTreeColumn;

		if (column instanceof TableColumn) {

			final TableColumn tableColumn = (TableColumn) column;

			colDef = (ColumnDefinition) tableColumn.getData();

		} else if (column instanceof TreeColumn) {

			final TreeColumn treeColumn = (TreeColumn) column;

			colDef = (ColumnDefinition) treeColumn.getData();
		}

		return colDef;
	}
 
開發者ID:wolfgang-ch,項目名稱:mytourbook,代碼行數:22,代碼來源:ColumnManager.java


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