Exemplo n.º 1
0
  @Override
  public boolean performFinish() {
    sCollection = page1.getCollection();
    sName = page4.getFile_Name();
    sPath = page4.getFile_Path();
    sFullPath = sPath + System.getProperty("file.separator") + sName;
    oColumns = page3.getColumns();
    sAttr = "";
    for (int i = 0; i < oColumns.size(); i++) {
      sAttr = sAttr + sCollection + ":" + oColumns.get(i) + " ";
    }
    sQuery = "selectattr " + sAttr + " ' '";
    ComboFile = page2.getComboFile();
    ComboString = page2.getCombo_String();
    p1btnselection = page1.btnall.getSelection();
    nColumnCount = page3.getItemCount();
    p1_1text = page1_1.text_editor.getText();
    if (p1btnselection == true) {
      rowCount = Integer.parseInt(page2.lblrow.getText());
    }
    lblsheet = page2.getSheetcount();
    IRunnableWithProgress op =
        new IRunnableWithProgress() {
          public void run(IProgressMonitor monitor) throws InvocationTargetException {
            try {
              doFinish(monitor);
            } finally {
              monitor.done();
            }
          }
        };
    try {
      getContainer().run(true, false, op);

    } catch (InterruptedException e) {
      return false;
    } catch (InvocationTargetException e) {
      Throwable realException = e.getTargetException();
      MessageDialog.openError(getShell(), "Error", realException.getMessage());
      return false;
    }

    return true;
  }
Exemplo n.º 2
0
  @Override
  public IWizardPage getNextPage() {
    ExportPage2 page2 = (ExportPage2) getWizard().getPage("ExportPage2");
    ExportPage1_1 page1_1 = (ExportPage1_1) getWizard().getPage("ExportPage1_1");
    if (btnall.getSelection() == true) {
      page2.combo.select(0);
      page2.combo_string.setEnabled(false);
      page2.lbllsheet.setText("# Excel sheet : ");
      page2.lbltip.setText(
          "\u203BTips :\r\n1. One file consists of max 7 sheats including 50,000 entries (Total : 350,000 entries)\r\n\r\r\n2. In case of a large scale of metadata, we recommend you to choose text format.");
      page2.combo.setEnabled(true);
      try {
        list = command.Command_Excel("SELECT COUNT(*) FROM " + str);
        double strr = Integer.parseInt(list.get(1));
        double strs = Math.ceil(strr / 50000);
        page2.setSheetcount((int) strs);
        double strf = Math.ceil(strr / 50000 / 2);
        page2.lblfile.setText("" + (int) strf);
        page2.lblsheet.setText("" + (int) strs);
        page2.lblrow.setText("" + (int) strr);
      } catch (Exception e1) {
        page2.lblrow.setText("0");
        page2.lblsheet.setText("0");
        page2.lblfile.setText("0");
      }
      return page2;
    } else {
      try {
        Boolean switchonplain = false;
        Boolean switchonacls = false;
        ArrayList<String> attrList = new ArrayList<String>();
        attrList = command.Command_ACL("stat " + str);
        if (attrList != null) {
          if (attrList.size() > 2) {
            String str = attrList.get(1);
            if (str.indexOf("plain") > 0) {
              switchonplain = true;
            }
            if (str.indexOf("acls") > 0) {
              switchonacls = true;
            }
          }
        }
        ArrayList<String> oList = command.Command_listAttr(str);
        String stemp = "selectattr ";
        String[] atemp;
        if (switchonplain == false) {
          stemp += " " + str + ":" + "FILE";
        }
        for (int i = 0; i < oList.size(); i++) {
          atemp = oList.get(i).split(":");
          stemp += " " + str + ":" + atemp[0];
        }
        if (switchonacls == true) {
          stemp += " " + str + ":" + "ACL";
        }
        stemp += "      '  '  ";
        page1_1.text_editor.setText("" + stemp);

      } catch (Exception e) {
        // TODO: handle exception
      }
      page2.lblrow.setText("-");
      page2.combo_string.setEnabled(true);
      page2.lblfile.setText("" + 1);
      page2.lbllsheet.setText("");
      page2.lblsheet.setText("");
      page2.lbltip.setText("");
      page2.combo.select(1);
      page2.combo.setEnabled(false);
      return page1_1;
    }
  }