本文整理汇总了Java中org.netbeans.swing.etable.ETableColumn类的典型用法代码示例。如果您正苦于以下问题:Java ETableColumn类的具体用法?Java ETableColumn怎么用?Java ETableColumn使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ETableColumn类属于org.netbeans.swing.etable包,在下文中一共展示了ETableColumn类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testDescendingSortingTreeWithNaturallyStringOrdering
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testDescendingSortingTreeWithNaturallyStringOrdering () throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etcm.setColumnSorted (etc, false, 1); // descending order
etc.setNestedComparator (testComarator);
view.expandNode (toExpand200_299);
// org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor (component, "", true, null);
// java.awt.Dialog d = org.openide.DialogDisplayer.getDefault ().createDialog (dd);
// d.setVisible (true);
// should look like
// - [2-index from 200 to 299]
// [299]
// [298]
// + [10-index from 100 to 199]
// ....
// + [1-index from 0 to 99]
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[10-index from 100 to 199]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[299]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[298]", view.getOutline ().getValueAt (3, 0).toString ());
}
示例2: testAscendingSortingTreeWithNaturallyStringOrdering
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testAscendingSortingTreeWithNaturallyStringOrdering () throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etcm.setColumnSorted (etc, true, 1); // ascending order
view.expandNode (toExpand0_99);
// org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor (component, "", true, null);
// java.awt.Dialog d = org.openide.DialogDisplayer.getDefault ().createDialog (dd);
// d.setVisible (true);
// should look like
// - [1-index from 0 to 99]
// [0]
// [10]
// [11]
// ....
// + [10-index from 100 to 199]
// + [2-index from 200 to 299]
assertEquals ("[1-index from 0 to 99]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[0]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[10]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[11]", view.getOutline ().getValueAt (3, 0).toString ());
assertEquals ("[10-index from 100 to 199]", view.getOutline ().getValueAt (101, 0).toString ());
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (102, 0).toString ());
}
示例3: testDescendingSortingTreeWithCustomComparator
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testDescendingSortingTreeWithCustomComparator () throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etc.setNestedComparator (testComarator);
etcm.setColumnSorted (etc, false, 1); // descending order
view.expandNode (toExpand200_299);
// org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor (component, "", true, null);
// java.awt.Dialog d = org.openide.DialogDisplayer.getDefault ().createDialog (dd);
// d.setVisible (true);
// should look like
// + [10-index from 100 to 199]
// - [2-index from 200 to 299]
// [299]
// [298]
// ....
// + [1-index from 0 to 99]
assertEquals ("[10-index from 100 to 199]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[299]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[298]", view.getOutline ().getValueAt (3, 0).toString ());
}
示例4: testAscendingSortingTreeWithCustomComparator
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testAscendingSortingTreeWithCustomComparator () throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etc.setNestedComparator (testComarator);
etcm.setColumnSorted (etc, true, 1); // ascending order
// org.openide.DialogDescriptor dd = new org.openide.DialogDescriptor (component, "", true, null);
// java.awt.Dialog d = org.openide.DialogDisplayer.getDefault ().createDialog (dd);
// d.setVisible (true);
view.expandNode (toExpand0_99);
// should look like
// - [1-index from 0 to 99]
// [0]
// [1]
// [2]
// ....
// + [2-index from 200 to 299]
// + [10-index from 100 to 199]
assertEquals ("[1-index from 0 to 99]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[0]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[1]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[2]", view.getOutline ().getValueAt (3, 0).toString ());
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (101, 0).toString ());
}
示例5: testRemoveNodeInOutlineView
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testRemoveNodeInOutlineView () throws InterruptedException {
StringKeys children = new StringKeys (true);
children.doSetKeys (new String [] {"1", "3", "2"});
Node root = new TestNode (children, "root");
comp = new OutlineViewComponent (root);
ETableColumnModel etcm = (ETableColumnModel) comp.getOutlineView ().getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etcm.setColumnSorted (etc, true, 1); // ascending order
TreeNode ta = Visualizer.findVisualizer(root);
DialogDescriptor dd = new DialogDescriptor (comp, "", false, null);
Dialog d = DialogDisplayer.getDefault ().createDialog (dd);
d.setVisible (true);
Thread.sleep (1000);
((StringKeys) root.getChildren ()).doSetKeys (new String [] {"1", "2"});
Thread.sleep (1000);
assertEquals ("Node on 0nd position is '1'", "1", ta.getChildAt (0).toString ());
assertEquals ("Node on 1st position is '2'", "2", ta.getChildAt (1).toString ());
d.setVisible (false);
}
示例6: setupColumns
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
private void setupColumns() {
// create colomns
ResourceBundle loc = NbBundle.getBundle(FileTablePanel.class);
if(versioningSystem != null) {
addPropertyColumn(RevisionNode.PROPERTY_NAME_VERSION, loc.getString("LBL_LocalHistory_Column_Version")); // NOI18N
setPropertyColumnDescription(RevisionNode.PROPERTY_NAME_VERSION, loc.getString("LBL_LocalHistory_Column_Version_Desc")); // NOI18N
addPropertyColumn(RevisionNode.PROPERTY_NAME_USER, loc.getString("LBL_LocalHistory_Column_User")); // NOI18N
setPropertyColumnDescription(RevisionNode.PROPERTY_NAME_USER, loc.getString("LBL_LocalHistory_Column_User_Desc")); // NOI18N
}
addPropertyColumn(RevisionNode.PROPERTY_NAME_LABEL, loc.getString("LBL_LocalHistory_Column_Label")); // NOI18N
setPropertyColumnDescription(RevisionNode.PROPERTY_NAME_LABEL, loc.getString("LBL_LocalHistory_Column_Label_Desc")); // NOI18N
// comparators
ETableColumnModel m = (ETableColumnModel) getOutline().getColumnModel();
ETableColumn etc = (ETableColumn) m.getColumn(0);
etc.setNestedComparator(new NodeComparator(etc));
m.setColumnSorted(etc, false, 1);
int idx = 1;
if(versioningSystem != null) {
setPropertyComparator(idx++);
setPropertyComparator(idx++);
}
setPropertyComparator(idx++);
}
示例7: constructor
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
/** To be called in constructor only. */
private void constructor() {
ic.add(ic); // needed for D&D linking between viewers
initComponents();
em = new ExplorerManager();
rootDefault = new AbstractNode(Children.LEAF);
rootDefault.setDisplayName("root");
root = rootDefault;
em.setRootContext(root);
Outline outline = table.getOutline();
outline.setRootVisible(false);
outline.setPopupUsedFromTheCorner(true);
outline.setFullyNonEditable(true);
outline.setDefaultRenderer(Node.Property.class, new CustomOutlineCellRenderer());
TableColumnModel columnModel = outline.getColumnModel();
ETableColumn column = (ETableColumn) columnModel.getColumn(0);
((ETableColumnModel) columnModel).setColumnHidden(column, true);
// listening for data in our lookup
dataResult = lkp.lookupResult(ChildFactory.class);
dataResult.addLookupListener(this);
}
示例8: transformValue
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
@Override
public Object transformValue(Object value) {
if (value instanceof ETableColumn) {
ETableColumn c = (ETableColumn) value;
return c.getHeaderValue ().toString ();
} else if (value instanceof AbstractButton) {
AbstractButton b = (AbstractButton) value;
Mnemonics.setLocalizedText (b, b.getText ());
return b;
} else if (value instanceof VisualizerNode) {
return Visualizer.findNode (value);
}
return PropertiesRowModel.getValueFromProperty(value);
}
示例9: testDescendingSortingTreeWithNaturallyStringOrderingViaETable
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testDescendingSortingTreeWithNaturallyStringOrderingViaETable () throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etc.setNestedComparator (testComarator);
view.getOutline ().setColumnSorted (0, false, 1); // descending order
view.expandNode (toExpand200_299);
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[10-index from 100 to 199]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[299]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[298]", view.getOutline ().getValueAt (3, 0).toString ());
}
示例10: testDescendingSortingTreeWithCustomComparatorViaETable
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testDescendingSortingTreeWithCustomComparatorViaETable() throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etc.setNestedComparator (testComarator);
view.getOutline().setColumnSorted (0, false, 1); // descending order
view.expandNode (toExpand200_299);
assertEquals ("[10-index from 100 to 199]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[299]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[298]", view.getOutline ().getValueAt (3, 0).toString ());
}
示例11: testAscendingSortingTreeWithCustomComparatorViaETable
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testAscendingSortingTreeWithCustomComparatorViaETable() throws InterruptedException, IllegalAccessException, InvocationTargetException {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline ().getColumnModel ();
ETableColumn etc = (ETableColumn) etcm.getColumn (0); // tree column
etc.setNestedComparator (testComarator);
view.getOutline().setColumnSorted (0, true, 1); // ascending order
view.expandNode (toExpand0_99);
assertEquals ("[1-index from 0 to 99]", view.getOutline ().getValueAt (0, 0).toString ());
assertEquals ("[0]", view.getOutline ().getValueAt (1, 0).toString ());
assertEquals ("[1]", view.getOutline ().getValueAt (2, 0).toString ());
assertEquals ("[2]", view.getOutline ().getValueAt (3, 0).toString ());
assertEquals ("[2-index from 200 to 299]", view.getOutline ().getValueAt (101, 0).toString ());
}
示例12: testColumnSortability
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
public void testColumnSortability() throws Exception {
ETableColumnModel etcm = (ETableColumnModel) view.getOutline().getColumnModel();
ETableColumn etc = (ETableColumn) etcm.getColumn(1);
boolean sortable = etc.isSortingAllowed();
assertEquals("Has to be sortable, initially.", true, sortable);
view.setPropertyColumnAttribute("unitTestPropName", "SortableColumn", Boolean.FALSE);
sortable = etc.isSortingAllowed();
assertEquals("Should not be sortable after attribute change.", false, sortable);
view.setPropertyColumnAttribute("unitTestPropName", "SortableColumn", Boolean.TRUE);
sortable = etc.isSortingAllowed();
assertEquals("Sortable, again.", true, sortable);
}
示例13: initColumns
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
private void initColumns () {
setModelProperties();
table.setColumnHidingAllowed(false);
for (int i = 0; i < table.getColumnCount(); ++i) {
((ETableColumn) table.getColumnModel().getColumn(i)).setNestedComparator(NodeComparator);
}
}
示例14: isTableSorted
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
private boolean isTableSorted() {
TableColumnModel tcm = treeModelRoot.getOutlineView().getOutline().getColumnModel();
Enumeration<TableColumn> cen = tcm.getColumns();
while (cen.hasMoreElements()) {
ETableColumn etc = (ETableColumn) cen.nextElement();
if (etc.isSorted()) {
return true;
}
}
return false;
}
示例15: setColumns
import org.netbeans.swing.etable.ETableColumn; //导入依赖的package包/类
/**
* Sets visible columns in the Versioning table.
*
* @param columns array of column names, they must be one of SyncFileNode.COLUMN_NAME_XXXXX constants.
*/
final void setColumns(String [] columns) {
if (Arrays.equals(columns, tableColumns)) return;
setModelProperties(columns);
tableColumns = columns;
for (int i = 0; i < columns.length; ++i) {
((ETableColumn) table.getColumnModel().getColumn(i)).setNestedComparator(NodeComparator);
}
setDefaultColumnSizes();
}