コード例 #1
0
  /** 초기 데이터를 로드합니다. */
  private void initData() {
    compositeServerStatus.initMongoDBInfoData(commandResult);
    compositeCollectionSummary.initData(userDB);

    // google analytic
    AnalyticCaller.track(MongoDBInfosEditor.ID);
  }
コード例 #2
0
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.verticalSpacing = 2;
    gridLayout.horizontalSpacing = 2;
    gridLayout.marginHeight = 2;
    gridLayout.marginWidth = 2;

    Composite compositeBody = new Composite(container, SWT.NONE);
    compositeBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    compositeBody.setLayout(new GridLayout(1, false));

    tadpoleEditor =
        new TadpoleEditorWidget(
            compositeBody, SWT.BORDER, EditorDefine.EXT_JSON, JSONUtil.getPretty(content), "");
    tadpoleEditor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    initUI();

    // google analytic
    AnalyticCaller.track(this.getClass().getName());

    return container;
  }
コード例 #3
0
  /** ui초기화 작업을 합니다. */
  private void initUI() {
    //		textMap.setText(TEMPLATE_MAP_SRC);
    //		textReduce.setText(TEMPLATE_REDUCE_SRC);
    //		textFinalize.setText(TEMPLATE_FINALIZE_SRC);

    textMap.setFocus();

    // google analytic
    AnalyticCaller.track(MapReduceEditor.ID);
  }
コード例 #4
0
  /**
   * resource load
   *
   * @param input
   */
  private void loadDBRsource(IEditorInput input) {
    TadpoleRDBEditorInput erdInput = (TadpoleRDBEditorInput) input;
    userDB = erdInput.getUserDBDAO();
    isAllTable = erdInput.isAllTable();

    // 신규로드 인지 기존 파일 로드 인지 검사합니다.
    if (null != erdInput.getUserDBERD()) {
      userDBErd = erdInput.getUserDBERD();

      // load resouce
      try {
        String xmlString = TadpoleSystem_UserDBResource.getResourceData(userDBErd);

        // 처음 로드 할때 ResourceSet에 instance가 등록 되어 있어야 합니다.
        /** <code>TadpolePackage.eNS_URI</code> */
        ResourceSet resourceSet = new ResourceSetImpl();
        if (resourceSet.getPackageRegistry().get("http://com.hangum.tadpole.rdb.model.ERDInfo")
            == null) {
          resourceSet
              .getPackageRegistry()
              .put("http://com.hangum.tadpole.rdb.model.ERDInfo", RdbPackage.eINSTANCE.getClass());
        }

        //
        XMLResourceImpl resource = new XMLResourceImpl();
        resource.setEncoding("UTF-8");
        resource.load(new InputSource(new StringReader(xmlString)), null);
        db = (DB) resource.getContents().get(0);

      } catch (Exception e) {
        logger.error("Load ERD Resource", e); // $NON-NLS-1$

        Status errStatus =
            new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); // $NON-NLS-1$
        ExceptionDetailsErrorDialog.openError(
            getSite().getShell(),
            "Error",
            Messages.get().TadpoleEditor_0,
            errStatus); //$NON-NLS-1$
      }

      setPartName(isAllTable ? "All " + userDBErd.getName() : userDBErd.getName());
      setTitleToolTip(userDB.getDisplay_name());
    } else {
      setPartName(isAllTable ? "All " + userDB.getDisplay_name() : userDB.getDisplay_name());
      setTitleToolTip(userDB.getDisplay_name());
    }

    // google analytic
    AnalyticCaller.track(TadpoleRDBEditor.ID, userDB.getDbms_type());
  }
コード例 #5
0
  private void initUI() {
    try {
      SqlMapClient sqlClient = TadpoleSQLManager.getInstance(userDB);
      List listTableInform =
          sqlClient.queryForList("tableInformation", userDB.getDb()); // $NON-NLS-1$

      tvTableInform.setInput(listTableInform);
      tvTableInform.refresh();
    } catch (Exception e) {
      logger.error("initialize session list", e); // $NON-NLS-1$

      Status errStatus =
          new Status(IStatus.ERROR, Activator.PLUGIN_ID, e.getMessage(), e); // $NON-NLS-1$
      ExceptionDetailsErrorDialog.openError(
          null, "Error", Messages.MainEditor_19, errStatus); // $NON-NLS-1$
    }

    // google analytic
    AnalyticCaller.track(RDBDBInfosEditor.ID, "TablesComposite"); // $NON-NLS-1$
  }
コード例 #6
0
  @Override
  protected Control createContents(Composite parent) {

    Composite container = new Composite(parent, SWT.NULL);
    container.setLayout(new GridLayout(2, false));

    Label lblResultType = new Label(container, SWT.NONE);
    lblResultType.setText(Messages.get().RDBPreferencePage_resultType);

    comboRDBResultType = new Combo(container, SWT.READ_ONLY);
    comboRDBResultType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    comboRDBResultType.add("Table");
    //		comboRDBResultType.add("Text");
    //		comboRDBResultType.add("JSON");
    comboRDBResultType.select(0);

    Label lblNumberColumnAdd = new Label(container, SWT.NONE);
    lblNumberColumnAdd.setText(Messages.get().RDBPreferencePage_lblNumberColumnAdd_text);

    comboRDBNumberComma = new Combo(container, SWT.READ_ONLY);
    comboRDBNumberComma.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    comboRDBNumberComma.add(PublicTadpoleDefine.YES_NO.YES.name());
    comboRDBNumberComma.add(PublicTadpoleDefine.YES_NO.NO.name());
    comboRDBNumberComma.select(0);

    Label lblNewLabel = new Label(container, SWT.NONE);
    lblNewLabel.setText(Messages.get().DefaultPreferencePage_0);

    textSelectLimit = new Text(container, SWT.BORDER);
    textSelectLimit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblNewLabel_1 = new Label(container, SWT.NONE);
    lblNewLabel_1.setText(Messages.get().DefaultPreferencePage_other_labelText_1);

    textResultPage = new Text(container, SWT.BORDER);
    textResultPage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblResultViewFont = new Label(container, SWT.NONE);
    lblResultViewFont.setText(Messages.get().RDBPreferencePage_lblResultViewFont_text);

    lblUserFont = new Label(container, SWT.NONE);
    lblUserFont.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    lblUserFont.setText("");
    new Label(container, SWT.NONE);

    Button btnNewButton = new Button(container, SWT.NONE);
    btnNewButton.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            setFontData();
          }
        });
    btnNewButton.setText(Messages.get().RDBPreferencePage_btnNewButton_text);

    Label lblQueryTimeout = new Label(container, SWT.NONE);
    lblQueryTimeout.setText(Messages.get().RDBPreferencePage_lblQueryTimeout_text);

    textQueryTimeout = new Text(container, SWT.BORDER);
    textQueryTimeout.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblCommitCount = new Label(container, SWT.NONE);
    lblCommitCount.setText(Messages.get().RDBPreferencePage_lblCommitCount_text);

    textCommitCount = new Text(container, SWT.BORDER);
    textCommitCount.setText(Messages.get().RDBPreferencePage_text_text);
    textCommitCount.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblCharacterShownIn = new Label(container, SWT.NONE);
    lblCharacterShownIn.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblCharacterShownIn.setText(Messages.get().RDBPreferencePage_lblCharacterShownIn_text);

    textShowInTheColumn = new Text(container, SWT.BORDER);
    textShowInTheColumn.setText(Messages.get().RDBPreferencePage_text_text_1);
    textShowInTheColumn.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label label = new Label(container, SWT.SEPARATOR | SWT.HORIZONTAL);
    label.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
    label.setText(""); // $NON-NLS-1$

    Label lblNewLabel_2 = new Label(container, SWT.NONE);
    lblNewLabel_2.setText(Messages.get().DefaultPreferencePage_other_labelText);

    textOraclePlan = new Text(container, SWT.BORDER);
    textOraclePlan.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(container, SWT.NONE);

    Button btnCreatePlanTable = new Button(container, SWT.NONE);
    btnCreatePlanTable.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            TadpoleSimpleMessageDialog planDialog =
                new TadpoleSimpleMessageDialog(
                    getShell(), textOraclePlan.getText(), ORACLE_PLAN_TABLE);
            planDialog.open();
          }
        });
    btnCreatePlanTable.setText(Messages.get().RDBPreferencePage_btnCreatePlanTable_text);

    initDefaultValue();

    // google analytic
    AnalyticCaller.track(this.getClass().getName());

    return container;
  }
コード例 #7
0
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.verticalSpacing = 2;
    gridLayout.horizontalSpacing = 2;
    gridLayout.marginHeight = 2;
    gridLayout.marginWidth = 2;

    Composite compositeBody = new Composite(container, SWT.NONE);
    GridLayout gl_compositeBody = new GridLayout(1, false);
    gl_compositeBody.verticalSpacing = 2;
    gl_compositeBody.horizontalSpacing = 2;
    gl_compositeBody.marginHeight = 2;
    gl_compositeBody.marginWidth = 2;
    compositeBody.setLayout(gl_compositeBody);
    compositeBody.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Composite compositeTable = new Composite(compositeBody, SWT.NONE);
    compositeTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
    compositeTable.setLayout(new GridLayout(3, false));

    lblTableName = new Label(compositeTable, SWT.NONE);
    lblTableName.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblTableName.setText(tableDAO.getName());

    Label lblAs = new Label(compositeTable, SWT.NONE);
    lblAs.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblAs.setText(" as "); // $NON-NLS-1$

    textTableAlias = new Text(compositeTable, SWT.BORDER);
    textTableAlias.addModifyListener(
        new ModifyListener() {
          public void modifyText(ModifyEvent event) {
            if (tableViewer.getInput() != null) {
              for (ExtendTableColumnDAO dao : (List<ExtendTableColumnDAO>) tableViewer.getInput()) {

                dao.setTableAlias(textTableAlias.getText());
              }
              tableViewer.refresh();
              queryGenetation();
            }
          }
        });
    textTableAlias.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(compositeTable, SWT.NONE);
    new Label(compositeTable, SWT.NONE);

    Text textTBNameCmt = new Text(compositeTable, SWT.BORDER | SWT.WRAP | SWT.MULTI);
    GridData gd_textTBNameCmt = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
    gd_textTBNameCmt.heightHint = 33;
    textTBNameCmt.setLayoutData(gd_textTBNameCmt);
    textTBNameCmt.setText(tableDAO.getComment());

    Composite compositeDML = new Composite(compositeBody, SWT.NONE);
    compositeDML.setLayout(new GridLayout(5, false));
    compositeDML.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Label lblDml = new Label(compositeDML, SWT.NONE);
    lblDml.setText("DML"); // $NON-NLS-1$

    rdoSelect = new Button(compositeDML, SWT.RADIO);
    rdoSelect.setSelection(true);
    rdoSelect.setText("SELECT"); // $NON-NLS-1$

    rdoUpdate = new Button(compositeDML, SWT.RADIO);
    rdoUpdate.setText("UPDATE"); // $NON-NLS-1$

    rdoInsert = new Button(compositeDML, SWT.RADIO);
    rdoInsert.setText("INSERT"); // $NON-NLS-1$

    rdoDelete = new Button(compositeDML, SWT.RADIO);
    rdoDelete.setText("DELETE"); // $NON-NLS-1$

    assignSelectionAdapter(rdoSelect);
    assignSelectionAdapter(rdoUpdate);
    assignSelectionAdapter(rdoInsert);
    assignSelectionAdapter(rdoDelete);

    tableViewer = new TableViewer(compositeBody, SWT.BORDER | SWT.FULL_SELECTION);
    Table table = tableViewer.getTable();
    table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    table.setLinesVisible(true);
    table.setHeaderVisible(true);

    TableViewerColumn tvColumnName = new TableViewerColumn(tableViewer, SWT.NONE);
    TableColumn tcColumnName = tvColumnName.getColumn();
    tcColumnName.setWidth(130);
    tcColumnName.setText(Messages.GenerateStatmentDMLDialog_8);
    tvColumnName.setEditingSupport(new DMLColumnEditingSupport(tableViewer, 0, this));

    TableViewerColumn tvColumnDataType = new TableViewerColumn(tableViewer, SWT.LEFT);
    TableColumn tcDataType = tvColumnDataType.getColumn();
    tcDataType.setWidth(85);
    tcDataType.setText(Messages.GenerateStatmentDMLDialog_9);

    TableViewerColumn tvColumnKey = new TableViewerColumn(tableViewer, SWT.CENTER);
    TableColumn tcKey = tvColumnKey.getColumn();
    tcKey.setWidth(50);
    tcKey.setText(Messages.GenerateStatmentDMLDialog_10);

    TableViewerColumn tvColumnAlias = new TableViewerColumn(tableViewer, SWT.NONE);
    TableColumn tcAlias = tvColumnAlias.getColumn();
    tcAlias.setWidth(100);
    tcAlias.setText(Messages.GenerateStatmentDMLDialog_11);
    tvColumnAlias.setEditingSupport(new DMLColumnEditingSupport(tableViewer, 3, this));

    TableViewerColumn tvColumnCmt = new TableViewerColumn(tableViewer, SWT.LEFT);
    TableColumn tcCmt = tvColumnCmt.getColumn();
    tcCmt.setWidth(300);
    tcCmt.setText(Messages.GenerateStatmentDMLDialog_12);

    Composite composite_3 = new Composite(compositeBody, SWT.NONE);
    composite_3.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gl_composite_3 = new GridLayout(2, false);
    gl_composite_3.verticalSpacing = 2;
    gl_composite_3.horizontalSpacing = 2;
    gl_composite_3.marginHeight = 2;
    gl_composite_3.marginWidth = 2;
    composite_3.setLayout(gl_composite_3);

    final Button btnAllCheck = new Button(composite_3, SWT.CHECK);
    btnAllCheck.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            for (ExtendTableColumnDAO dao : (List<ExtendTableColumnDAO>) tableViewer.getInput()) {
              if ("*".equals(dao.getField())) { // $NON-NLS-1$
                dao.setCheck(!btnAllCheck.getSelection());
              } else {
                dao.setCheck(btnAllCheck.getSelection());
              }
            }
            tableViewer.refresh();
            queryGenetation();
          }
        });
    btnAllCheck.setText(Messages.GenerateStatmentDMLDialog_14);

    chkComment = new Button(composite_3, SWT.CHECK);
    chkComment.setText(Messages.GenerateStatmentDMLDialog_15);
    assignSelectionAdapter(chkComment);

    Composite previewComposite = new Composite(compositeBody, SWT.BORDER);
    previewComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gl_previewComposite = new GridLayout(1, false);
    gl_previewComposite.verticalSpacing = 2;
    gl_previewComposite.horizontalSpacing = 2;
    gl_previewComposite.marginHeight = 2;
    gl_previewComposite.marginWidth = 2;
    previewComposite.setLayout(gl_previewComposite);

    textQuery =
        new Text(
            previewComposite,
            SWT.BORDER | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL | SWT.CANCEL | SWT.MULTI);
    GridData gd_textQuery = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
    gd_textQuery.minimumHeight = 120;
    textQuery.setLayoutData(gd_textQuery);

    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setLabelProvider(new GenerateLabelProvider());

    initData();
    queryGenetation();

    // google analytic
    AnalyticCaller.track(this.getClass().getName());

    textTableAlias.setFocus();

    return container;
  }
コード例 #8
0
  /**
   * Create contents of the dialog.
   *
   * @param parent
   */
  @Override
  protected Control createDialogArea(Composite parent) {
    Composite container = (Composite) super.createDialogArea(parent);
    GridLayout gridLayout = (GridLayout) container.getLayout();
    gridLayout.numColumns = 2;
    gridLayout.verticalSpacing = 5;
    gridLayout.horizontalSpacing = 5;
    gridLayout.marginHeight = 5;
    gridLayout.marginWidth = 5;

    Composite compositeLeftBtn = new Composite(container, SWT.NONE);
    compositeLeftBtn.setLayout(new GridLayout(1, false));

    Button button = new Button(compositeLeftBtn, SWT.NONE);
    button.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    button.setImage(
        ResourceManager.getPluginImage(
            BrowserActivator.ID, "resources/TadpoleOverView.png")); // $NON-NLS-1$

    compositeLogin = new Composite(container, SWT.NONE);
    compositeLogin.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    compositeLogin.setLayout(new GridLayout(3, false));

    lblEmail = new Label(compositeLogin, SWT.NONE);
    lblEmail.setText(Messages.get().LoginDialog_1);

    textEMail = new Text(compositeLogin, SWT.BORDER);
    textEMail.addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyReleased(KeyEvent e) {
            if (e.keyCode == SWT.Selection) {
              if (!"".equals(textPasswd.getText())) okPressed(); // $NON-NLS-1$
              else textPasswd.setFocus();
            }
          }
        });
    textEMail.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    btnCheckButton = new Button(compositeLogin, SWT.CHECK);
    btnCheckButton.setText(Messages.get().LoginDialog_9); // $NON-NLS-1$

    lblPassword = new Label(compositeLogin, SWT.NONE);
    lblPassword.setText(Messages.get().LoginDialog_4);

    textPasswd = new Text(compositeLogin, SWT.BORDER | SWT.PASSWORD);
    textPasswd.addKeyListener(
        new KeyAdapter() {
          @Override
          public void keyReleased(KeyEvent e) {
            if (e.keyCode == SWT.Selection) {
              okPressed();
            }
          }
        });
    textPasswd.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Button btnLogin = new Button(compositeLogin, SWT.NONE);
    btnLogin.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            okPressed();
          }
        });
    btnLogin.setText(Messages.get().LoginDialog_15);

    lblLanguage = new Label(compositeLogin, SWT.NONE);
    lblLanguage.setText(Messages.get().LoginDialog_lblLanguage_text);

    comboLanguage = new Combo(compositeLogin, SWT.READ_ONLY);
    comboLanguage.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            changeUILocale();
          }
        });
    comboLanguage.add(Locale.ENGLISH.getDisplayLanguage());
    comboLanguage.add(Locale.KOREAN.getDisplayLanguage());

    comboLanguage.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));

    comboLanguage.setData(Locale.ENGLISH.getDisplayLanguage(), Locale.ENGLISH);
    comboLanguage.setData(Locale.KOREAN.getDisplayLanguage(), Locale.KOREAN);

    //		comboLanguage.select(0);

    // ---------------------  Registered database
    // ----------------------------------------------------
    //		try {
    //			listDBMart = getDBMart();
    //			if(!listDBMart.isEmpty()) {
    //				Group grpSponser = new Group(container, SWT.NONE);
    //				GridLayout gl_grpSponser = new GridLayout(1, false);
    //				gl_grpSponser.verticalSpacing = 0;
    //				gl_grpSponser.horizontalSpacing = 0;
    //				gl_grpSponser.marginHeight = 0;
    //				gl_grpSponser.marginWidth = 0;
    //				grpSponser.setLayout(gl_grpSponser);
    //				grpSponser.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
    //				grpSponser.setForeground(SWTResourceManager.getColor(SWT.COLOR_BLUE));
    //				grpSponser.setText(Messages.get().LoginDialog_grpSponser_text);
    //
    //				makeBarChart(grpSponser, listDBMart);
    //			}
    //		} catch(Exception e) {
    //			logger.error("get initdata", e); //$NON-NLS-1$
    //		}

    compositeLetter = new Group(container, SWT.NONE);
    compositeLetter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 2, 1));
    GridLayout gl_compositeLetter = new GridLayout(2, false);
    compositeLetter.setLayout(gl_compositeLetter);
    compositeLetter.setText(Messages.get().LoginDialog_grpShowInformation_text);

    lblSite = new Label(compositeLetter, SWT.NONE);
    lblSite.setText(Messages.get().LoginDialog_lblSite_text);

    Label lblNewLabel = new Label(compositeLetter, SWT.NONE);
    lblNewLabel.setText(
        "<a href='"
            + Messages.get().LoginDialog_lblNewLabel_text_1
            + "' target='_blank'>"
            + Messages.get().LoginDialog_lblNewLabel_text_1
            + "</a>"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
    lblNewLabel.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    lblUserGuide = new Label(compositeLetter, SWT.NONE);
    lblUserGuide.setText(Messages.get().LoginDialog_lblUserGuide_text);

    Composite compositeUserGide = new Composite(compositeLetter, SWT.NONE);
    compositeUserGide.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    GridLayout gl_compositeUserGide = new GridLayout(3, false);
    gl_compositeUserGide.verticalSpacing = 1;
    gl_compositeUserGide.horizontalSpacing = 1;
    gl_compositeUserGide.marginHeight = 1;
    gl_compositeUserGide.marginWidth = 1;
    compositeUserGide.setLayout(gl_compositeUserGide);

    Label lblUserKor = new Label(compositeUserGide, SWT.NONE);
    lblUserKor.setText(
        "<a href='https://tadpoledbhub.atlassian.net/wiki/pages/viewpage.action?pageId=20578325' target='_blank'>(Korean)</a>"); //$NON-NLS-1$ //$NON-NLS-2$
    lblUserKor.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    Label lblUserEng = new Label(compositeUserGide, SWT.NONE);
    lblUserEng.setText(
        "<a href='https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-Eng' target='_blank'>(English)</a>"); //$NON-NLS-1$ //$NON-NLS-2$
    lblUserEng.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    Label lblUserIndonesia = new Label(compositeUserGide, SWT.NONE);
    lblUserIndonesia.setText(
        "<a href='https://github.com/hangum/TadpoleForDBTools/wiki/RDB-User-Guide-ID' target='_blank'>(Indonesia)</a>"); //$NON-NLS-1$ //$NON-NLS-2$
    lblUserIndonesia.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    //		Label lblIssues = new Label(compositeLetter, SWT.NONE);
    //		lblIssues.setText(Messages.get().LoginDialog_lblIssues_text);
    //
    //		Label lblIssue = new Label(compositeLetter, SWT.NONE);
    //		lblIssue.setText("<a href='https://github.com/hangum/TadpoleForDBTools/issues'
    // target='_blank'>https://github.com/hangum/TadpoleForDBTools/issues</a>"); //$NON-NLS-1$
    // //$NON-NLS-2$
    //		lblIssue.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    lblContact = new Label(compositeLetter, SWT.NONE);
    lblContact.setText(Messages.get().LoginDialog_lblContact_text_1);

    Label lblContactUrl = new Label(compositeLetter, SWT.NONE);
    try {
      UserDAO systemUserDao = TadpoleApplicationContextManager.getSystemAdmin();
      lblContactUrl.setText(
          String.format(
              "<a href='mailto:%s'>%s(%s)</a>",
              systemUserDao.getEmail(),
              systemUserDao.getName(),
              systemUserDao.getEmail())); // $NON-NLS-1$ //$NON-NLS-2$
    } catch (Exception e1) {
      lblContactUrl.setText(
          "<a href='mailto:[email protected]'>Admin([email protected])</a>"); //$NON-NLS-1$
      // //$NON-NLS-2$
    }
    lblContactUrl.setData(RWT.MARKUP_ENABLED, Boolean.TRUE);

    Label lblDonation = new Label(compositeLetter, SWT.NONE);
    //		lblDonation.setText(Messages.get().LoginDialog_lblDonation_text);

    Browser browser = new Browser(compositeLetter, SWT.NONE);
    browser.setLayoutData(new GridData(SWT.FILL, SWT.RIGHT, false, false, 1, 1));
    browser.setText(strPaypal);

    AnalyticCaller.track("login"); // $NON-NLS-1$

    initUI();

    return compositeLogin;
  }
コード例 #9
0
  @Override
  public void createPartControl(Composite parent) {
    GridLayout gl_parent = new GridLayout(1, false);
    gl_parent.verticalSpacing = 0;
    gl_parent.horizontalSpacing = 0;
    gl_parent.marginHeight = 0;
    gl_parent.marginWidth = 0;
    parent.setLayout(gl_parent);

    SashForm sashFormMain = new SashForm(parent, SWT.VERTICAL);
    sashFormMain.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Composite compositeMapReduceFinalize = new Composite(sashFormMain, SWT.NONE);
    GridLayout gl_compositeMapReduceFinalize = new GridLayout(1, false);
    gl_compositeMapReduceFinalize.verticalSpacing = 1;
    gl_compositeMapReduceFinalize.horizontalSpacing = 1;
    gl_compositeMapReduceFinalize.marginHeight = 1;
    gl_compositeMapReduceFinalize.marginWidth = 1;
    compositeMapReduceFinalize.setLayout(gl_compositeMapReduceFinalize);

    SashForm sashFormMRF = new SashForm(compositeMapReduceFinalize, SWT.NONE);
    sashFormMRF.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Group grpMap = new Group(sashFormMRF, SWT.NONE);
    grpMap.setText("Map");
    GridLayout gl_grpMap = new GridLayout(1, false);
    gl_grpMap.verticalSpacing = 1;
    gl_grpMap.horizontalSpacing = 1;
    gl_grpMap.marginHeight = 1;
    gl_grpMap.marginWidth = 1;
    grpMap.setLayout(gl_grpMap);

    String strAssist = CollectionUtils.getAssistList(userDB, initColName);

    textMap = new TadpoleEditorWidget(grpMap, SWT.BORDER, EditorDefine.EXT_JSON, "", strAssist);
    textMap.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Group grpReduce = new Group(sashFormMRF, SWT.NONE);
    grpReduce.setText("Reduce");
    GridLayout gl_grpReduce = new GridLayout(1, false);
    gl_grpReduce.verticalSpacing = 1;
    gl_grpReduce.horizontalSpacing = 1;
    gl_grpReduce.marginHeight = 1;
    gl_grpReduce.marginWidth = 1;
    grpReduce.setLayout(gl_grpReduce);

    textReduce =
        new TadpoleEditorWidget(grpReduce, SWT.BORDER, EditorDefine.EXT_JSON, "", strAssist);
    textReduce.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Group grpFinalize = new Group(sashFormMRF, SWT.NONE);
    grpFinalize.setText("Finalize");
    GridLayout gl_grpFinalize = new GridLayout(1, false);
    gl_grpFinalize.verticalSpacing = 1;
    gl_grpFinalize.horizontalSpacing = 1;
    gl_grpFinalize.marginHeight = 1;
    gl_grpFinalize.marginWidth = 1;
    grpFinalize.setLayout(gl_grpFinalize);

    textFinalize =
        new TadpoleEditorWidget(grpFinalize, SWT.BORDER, EditorDefine.EXT_JSON, "", strAssist);
    textFinalize.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    sashFormMRF.setWeights(new int[] {4, 4, 2});

    Composite compositeInOut = new Composite(sashFormMain, SWT.NONE);
    GridLayout gl_compositeInOut = new GridLayout(1, false);
    gl_compositeInOut.verticalSpacing = 1;
    gl_compositeInOut.horizontalSpacing = 1;
    gl_compositeInOut.marginHeight = 1;
    gl_compositeInOut.marginWidth = 1;
    compositeInOut.setLayout(gl_compositeInOut);

    SashForm sashForm = new SashForm(compositeInOut, SWT.NONE);
    sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Group grpInput = new Group(sashForm, SWT.NONE);
    grpInput.setText("Input");
    GridLayout gl_grpInput = new GridLayout(2, false);
    gl_grpInput.verticalSpacing = 2;
    gl_grpInput.horizontalSpacing = 2;
    gl_grpInput.marginHeight = 2;
    gl_grpInput.marginWidth = 2;
    grpInput.setLayout(gl_grpInput);

    Label lblQuery = new Label(grpInput, SWT.NONE);
    lblQuery.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblQuery.setText("Query");

    textQuery = new TadpoleEditorWidget(grpInput, SWT.BORDER, EditorDefine.EXT_JSON, "", strAssist);
    textQuery.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Label lblSort = new Label(grpInput, SWT.NONE);
    lblSort.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblSort.setText("Sort");

    textSort = new TadpoleEditorWidget(grpInput, SWT.BORDER, EditorDefine.EXT_JSON, "", strAssist);
    textSort.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    Label lblLimit = new Label(grpInput, SWT.NONE);
    lblLimit.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblLimit.setText("Limit");

    textLimit = new Text(grpInput, SWT.BORDER);
    textLimit.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));

    Group grpOutput_1 = new Group(sashForm, SWT.NONE);
    grpOutput_1.setText("Output");
    GridLayout gl_grpOutput_1 = new GridLayout(2, false);
    gl_grpOutput_1.verticalSpacing = 2;
    gl_grpOutput_1.horizontalSpacing = 2;
    gl_grpOutput_1.marginHeight = 2;
    gl_grpOutput_1.marginWidth = 2;
    grpOutput_1.setLayout(gl_grpOutput_1);

    Label lblType = new Label(grpOutput_1, SWT.NONE);
    lblType.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblType.setText("Type");

    comboOutputType = new Combo(grpOutput_1, SWT.READ_ONLY);
    comboOutputType.setEnabled(false);
    comboOutputType.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    for (OutputType outputType : MapReduceCommand.OutputType.values()) {
      comboOutputType.add(outputType.toString());
      comboOutputType.setData(outputType.toString(), outputType);
    }
    comboOutputType.select(3);

    Label lblOutput = new Label(grpOutput_1, SWT.NONE);
    lblOutput.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    lblOutput.setText("Output");

    textOutputTarget = new Text(grpOutput_1, SWT.BORDER);
    textOutputTarget.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    new Label(grpOutput_1, SWT.NONE);

    btnSharded = new Button(grpOutput_1, SWT.CHECK);
    btnSharded.setText("Sharded ");
    new Label(grpOutput_1, SWT.NONE);

    btnNoneAtomic = new Button(grpOutput_1, SWT.CHECK);
    btnNoneAtomic.setText("None Atomic");
    new Label(grpOutput_1, SWT.NONE);

    btnJsMode = new Button(grpOutput_1, SWT.CHECK);
    btnJsMode.setText("JS Mode");
    new Label(grpOutput_1, SWT.NONE);

    Button btnExecute = new Button(grpOutput_1, SWT.NONE);
    btnExecute.addSelectionListener(
        new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e) {
            try {
              executeMapReduce();
            } catch (Exception e1) {
              logger.error("MapReduce Error", e1); // $NON-NLS-1$
              Status errStatus =
                  new Status(
                      IStatus.ERROR, Activator.PLUGIN_ID, e1.getMessage(), e1); // $NON-NLS-1$
              ExceptionDetailsErrorDialog.openError(
                  null,
                  "Error",
                  "MapReduce Search exception",
                  errStatus); //$NON-NLS-1$ //$NON-NLS-2$
            }
          }
        });
    btnExecute.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
    btnExecute.setText("Search");

    sashForm.setWeights(new int[] {1, 1});

    compositeResult =
        new MongodbResultComposite(sashFormMain, SWT.NONE, userDB, initColName, false);
    compositeResult.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
    GridLayout gl_compositeResult = new GridLayout(1, false);
    gl_compositeResult.verticalSpacing = 0;
    gl_compositeResult.horizontalSpacing = 0;
    gl_compositeResult.marginHeight = 0;
    gl_compositeResult.marginWidth = 0;
    compositeResult.setLayout(gl_compositeResult);

    sashFormMain.setWeights(new int[] {40, 30, 30});

    initUI();

    // google analytic
    AnalyticCaller.track(this.getClass().getName());
  }