public String printFormatData(DataItems data) {
   String ret = "";
   StringWriter sw = new StringWriter();
   BufferedWriter bw = new BufferedWriter(sw);
   int numRows = data.getLength();
   try {
     for (int row = 0; row < numRows; row++) {
       DataItem s = data.getElementAt(row);
       bw.write(s.toString());
       bw.write("\r\n");
     }
   } catch (IOException e) {
     e.printStackTrace();
   } finally {
     ret = sw.toString();
     if (bw != null)
       try {
         bw.close();
       } catch (Exception ee) {
       }
     if (sw != null)
       try {
         sw.close();
       } catch (Exception ee) {
       }
   }
   return ret;
 }
Beispiel #2
0
 /**
  * Add a component to the tabbed pane.
  *
  * @param item the component to add.
  */
 protected void addDataItem(DataItem item) {
   if (LOG.isDebugEnabled()) {
     LOG.debug(
         name
             + Messages.getString(BUNDLE_NAME, "Folder.20")
             + item.getDataItemName()
             + Messages.getString(BUNDLE_NAME, "Folder.21")); // $NON-NLS-1$ //$NON-NLS-2$
   }
   item.setBorder(new EmptyBorder(5, 5, 5, 5));
   dataItems.add(item);
   String title = item.getTitle();
   if (title == null || title.length() == 0) {
     title = item.toString();
   }
   tabbedPane.addTab(title, item);
 }