コード例 #1
0
 private toolbarAction get_parentAction() {
   Vector<Vector<String>> resultRows = new Vector<Vector<String>>();
   toolbarAction action = null;
   try {
     String currentDocumentType = BungeniEditorProperties.getEditorProperty("activeDocumentMode");
     dbSettings.Connect();
     QueryResults qr =
         dbSettings.QueryResults(
             SettingsQueryFactory.Q_FETCH_ACTION_BY_NAME(
                 currentDocumentType, this.m_subAction.parent_action_name()));
     dbSettings.EndConnect();
     if (qr == null) {
       throw new Exception("QueryResults returned null");
     }
     if (qr.hasResults()) {
       HashMap columns = qr.columnNameMap();
       // child actions are present
       // call the result nodes recursively...
       resultRows = qr.theResults();
       // should alwayrs return a single result
       Vector<java.lang.String> tableRow = new Vector<java.lang.String>();
       tableRow = resultRows.elementAt(0);
       action = new toolbarAction(tableRow, columns);
     }
   } catch (Exception ex) {
     log.error("getParentSection: " + ex.getMessage());
   } finally {
     return action;
   }
 }
コード例 #2
0
  private void initData() {
    dbInstance.Connect();
    QueryResults qr =
        dbInstance.QueryResults(
            "select document_title, document_uri, document_date from tabled_documents");
    dbInstance.EndConnect();

    if (qr != null) {
      if (qr.hasResults()) {
        Vector<Vector<String>> resultRows = new Vector<Vector<String>>();
        resultRows = qr.theResults();

        DefaultTableModel mdl = new DefaultTableModel();
        mdl.setDataVector(resultRows, qr.getColumnsAsVector());
        tbl_tabledDocs.setModel(mdl);
      }
    }
  }