Exemplo n.º 1
0
    public void onSubmit() {

      termMoveObj.setNewConceptURI((String) destConcept.getValue());
      termMoveObj.setOldConceptURI(conceptObject.getUri());
      termMoveObj.setTermObj(tObj);

      AsyncCallback<TermMoveObject> callback =
          new AsyncCallback<TermMoveObject>() {
            public void onSuccess(TermMoveObject results) {
              panel.clear();
              panel.add(getTable(results));
            }

            public void onFailure(Throwable caught) {
              ExceptionManager.showException(caught, constants.conceptDeleteTermFail());
            }
          };

      OwlStatus status = (OwlStatus) initData.getActionStatus().get(ConceptActionKey.termDelete);
      int actionId =
          Integer.parseInt((String) initData.getActionMap().get(ConceptActionKey.termDelete));

      Service.conceptService.moveTerm(
          MainApp.userOntology, actionId, status, MainApp.userId, tObj, termMoveObj, callback);
    }
Exemplo n.º 2
0
  private HorizontalPanel getConcept() {
    HorizontalPanel conceptHp = new HorizontalPanel();
    conceptHp.add(conceptLabel);
    conceptLabel.addStyleName("gwt-Textbox");
    conceptBrowse = new Image("images/browseButton3-grey.gif");
    conceptBrowse.setStyleName(Style.Link);
    conceptBrowse.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            final ConceptBrowser cb = ((MainApp) RootPanel.get().getWidget(0)).conceptBrowser;
            cb.showBrowser();
            cb.addSubmitClickHandler(
                new ClickHandler() {
                  public void onClick(ClickEvent event) {
                    conceptLabel.setValue(cb.getSelectedItem(), cb.getTreeObject());
                    exp.setConceptURI(cb.getTreeObject().getUri());
                  }
                });
          }
        });
    conceptHp.add(conceptBrowse);

    conceptClear = new Image("images/trash-grey.gif");
    conceptClear.setTitle(constants.buttonClear());
    conceptClear.setStyleName(Style.Link);
    conceptClear.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            conceptLabel.setText("");
            exp.setConceptURI(null);
          }
        });
    conceptHp.add(conceptClear);

    conceptChildren = new CheckBox(constants.exportIncludeChildren(), true);
    conceptChildren.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            exp.setIncludeChildren(((CheckBox) event.getSource()).getValue());
          }
        });
    conceptHp.add(conceptChildren);
    conceptHp.setSpacing(3);
    conceptHp.setWidth("100%");
    conceptHp.setCellHorizontalAlignment(conceptLabel, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellHorizontalAlignment(conceptBrowse, HasHorizontalAlignment.ALIGN_RIGHT);
    conceptHp.setCellHorizontalAlignment(conceptChildren, HasHorizontalAlignment.ALIGN_LEFT);
    conceptHp.setCellWidth(conceptLabel, "80%");
    return conceptHp;
  }
Exemplo n.º 3
0
    public boolean passCheckInput() {
      boolean pass = false;
      if (destConcept == null) {
        pass = false;
      } else {
        String dObj = (String) destConcept.getValue();
        if (dObj == null) {
          pass = false;
        } else {

          if ((((String) dObj).length() == 0)) {
            pass = false;
          } else {
            pass = true;
          }
        }
      }
      return pass;
    }