Search in sources :

Example 1 with ClassList

use of com.cubrid.cubridmanager.core.cubrid.table.model.ClassList in project cubrid-manager by CUBRID.

the class SelectTableComp method fillTableViewer.

/**
	 * 
	 * Fill the data for table viewer
	 * 
	 * @param dbClasses DBClasses
	 */
public void fillTableViewer(DBClasses dbClasses) {
    List<Map<String, String>> classList = new ArrayList<Map<String, String>>();
    if (dbClasses != null) {
        ClassList userClassList = dbClasses.getUserClassList();
        if (userClassList != null) {
            List<ClassItem> classItemList = userClassList.getClassList();
            for (int i = 0; classItemList != null && i < classItemList.size(); i++) {
                Map<String, String> map = new HashMap<String, String>();
                ClassItem item = classItemList.get(i);
                if (item != null && !item.isVirtual()) {
                    map.put("0", item.getClassname());
                    classList.add(map);
                }
            }
        }
    }
    if (tableViewer != null && selectClassesTable != null && !selectClassesTable.isDisposed()) {
        tableViewer.setInput(classList);
        for (int i = 0; i < selectClassesTable.getColumnCount(); i++) {
            selectClassesTable.getColumn(i).pack();
        }
    }
}
Also used : ClassItem(com.cubrid.cubridmanager.core.cubrid.table.model.ClassItem) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) ClassList(com.cubrid.cubridmanager.core.cubrid.table.model.ClassList) HashMap(java.util.HashMap) Map(java.util.Map)

Example 2 with ClassList

use of com.cubrid.cubridmanager.core.cubrid.table.model.ClassList in project cubrid-manager by CUBRID.

the class GetClassListTaskTest method testClassInfo.

public void testClassInfo() {
    if (StringUtil.isEqual(SystemParameter.getParameterValue("useMockTest"), "n"))
        return;
    System.out.println("<table.classinfo.001.req.txt>");
    GetClassListTask task = new GetClassListTask(serverInfo);
    task.setDbName("demodb");
    task.setDbStatus(OnOffType.OFF);
    task.execute();
    assertTrue(task.isSuccess());
    DBClasses classes = task.getDbClassInfo();
    ClassList classList = classes.getSystemClassList();
    List<ClassItem> list = classList.getClassList();
    assertEquals("db_root", list.get(0).getClassname());
}
Also used : ClassItem(com.cubrid.cubridmanager.core.cubrid.table.model.ClassItem) DBClasses(com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses) ClassList(com.cubrid.cubridmanager.core.cubrid.table.model.ClassList)

Aggregations

ClassItem (com.cubrid.cubridmanager.core.cubrid.table.model.ClassItem)2 ClassList (com.cubrid.cubridmanager.core.cubrid.table.model.ClassList)2 DBClasses (com.cubrid.cubridmanager.core.cubrid.table.model.DBClasses)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1