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


Java ETableColumn.setNestedComparator方法代碼示例

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


在下文中一共展示了ETableColumn.setNestedComparator方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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 ());
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:OutlineViewTest.java

示例2: 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 ());
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:24,代碼來源:OutlineViewTest.java

示例3: 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 ());
    }
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:27,代碼來源:OutlineViewTest.java

示例4: 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++);                
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:25,代碼來源:HistoryFileView.java

示例5: 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 ());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:OutlineViewTest.java

示例6: 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 ());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:OutlineViewTest.java

示例7: 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 ());
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:14,代碼來源:OutlineViewTest.java

示例8: setPropertyComparator

import org.netbeans.swing.etable.ETableColumn; //導入方法依賴的package包/類
private void setPropertyComparator(int idx) {
    ETableColumn etc1 = (ETableColumn) getOutline().getColumnModel().getColumn(idx++);
    etc1.setNestedComparator(new PropertyComparator(etc1));
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:5,代碼來源:HistoryFileView.java


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