Search in sources :

Example 1 with SchoolMgrerSpreadSheetView

use of com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView in project Gargoyle by callakrsos.

the class SqlMultiplePane method menuExportSpreadSheetOnAction.

/**
	 * export spreadSheet event
	 *
	 * @param e
	 */
public void menuExportSpreadSheetOnAction(ActionEvent e) {
    // 탭을 로드할 수 있는 프록시 객체를 불러옴
    if (tabProxy == null) {
        tabProxy = GagoyleTabProxy.getInstance();
    }
    // 그리드 데이터를 copy
    StringBuffer columnBuf = new StringBuffer();
    StringBuffer dataBuf = new StringBuffer();
    ObservableList<Map<String, Object>> items = getTbResult().getItems();
    boolean isFirst = true;
    for (Map<String, Object> map : items) {
        Iterator<String> iterator = map.keySet().iterator();
        while (iterator.hasNext()) {
            String column = iterator.next();
            if (isFirst)
                columnBuf.append(column).append("\t");
            dataBuf.append(map.get(column)).append("\t");
        }
        dataBuf.append("\n");
        if (isFirst) {
            isFirst = false;
            columnBuf.append("\n");
        }
    }
    String putString = new StringBuffer().append(columnBuf).append(dataBuf).toString();
    SchoolMgrerSpreadSheetView parent = new SchoolMgrerSpreadSheetView();
    parent.paste(putString, 0, 0);
    tabProxy.loadNewSystemTab(SystemLayoutViewController.TAB_TITLE_SPREAD_SHEET, parent);
}
Also used : SchoolMgrerSpreadSheetView(com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView) Map(java.util.Map) HashMap(java.util.HashMap)

Example 2 with SchoolMgrerSpreadSheetView

use of com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView in project Gargoyle by callakrsos.

the class SqlPane method menuExportSpreadSheetOnAction.

/**
	 * export spreadSheet event
	 *
	 * @param e
	 */
public void menuExportSpreadSheetOnAction(ActionEvent e) {
    // 탭을 로드할 수 있는 프록시 객체를 불러옴
    if (tabProxy == null) {
        tabProxy = GagoyleTabProxy.getInstance();
    }
    // 그리드 데이터를 copy
    StringBuffer columnBuf = new StringBuffer();
    StringBuffer dataBuf = new StringBuffer();
    List<Map<String, Object>> items = getTbResult().getItems();
    boolean isFirst = true;
    int colSize = 27;
    for (Map<String, Object> map : items) {
        Iterator<String> iterator = map.keySet().iterator();
        while (iterator.hasNext()) {
            String column = iterator.next();
            if (isFirst)
                columnBuf.append(column).append('\t');
            dataBuf.append(map.get(column)).append('\t');
        }
        dataBuf.append('\n');
        if (isFirst) {
            isFirst = false;
            columnBuf.append('\n');
            colSize = map.size();
        }
    }
    if (colSize < 27)
        colSize = 27;
    String putString = new StringBuffer().append(columnBuf).append(dataBuf).toString();
    SchoolMgrerSpreadSheetView parent = new SchoolMgrerSpreadSheetView(colSize);
    // parent.paste(putString, 0, 0);
    parent.paste(items, 0, 0);
    tabProxy.loadNewSystemTab(SystemLayoutViewController.TAB_TITLE_SPREAD_SHEET, parent);
}
Also used : SchoolMgrerSpreadSheetView(com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView) Map(java.util.Map) TreeMap(java.util.TreeMap) HashMap(java.util.HashMap)

Aggregations

SchoolMgrerSpreadSheetView (com.kyj.fx.voeditor.visual.main.layout.SchoolMgrerSpreadSheetView)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 TreeMap (java.util.TreeMap)1