Package com.google.gwt.user.client.ui

Examples of com.google.gwt.user.client.ui.VerticalPanel


  OntologySelection(VineEditorPanel mainPanel) {
    super();
    this.mainPanel = mainPanel;
   
   
    VerticalPanel layout = new VerticalPanel();
    DecoratorPanel decPanel = new DecoratorPanel();
      decPanel.setWidget(layout);
      add(decPanel);

      layout.setSpacing(5);
   
   
      HorizontalPanel hp = new HorizontalPanel();
      hp.setVerticalAlignment(ALIGN_MIDDLE);
    layout.add(hp);
   
    if ( mainPanel.isReadOnly() ) {
      hp.add(new TLabel("Mapped ontologies:",
          "The ontologies where the mapped entities where taken from. " +
          "<br/>" +
          "These ontologies are given " +
          "codes, starting from 'A', to identify them in " +
          "the rest of the VINE interface. "
      ));
    }
    else {
      hp.add(new TLabel("Working ontologies:",
          "This section lists the ontologies whose entities can be mapped. " +
          "Use the \"Add\" button to add a working ontology. " +
          "<br/>" +
          "These ontologies are given " +
          "codes, starting from 'A', to identify them in " +
          "the rest of the VINE interface. "
      ));
     
      final PushButton addButton = new PushButton("Add...");
      addButton.setTitle("Allows to add a working ontology");
      DOM.setElementAttribute(addButton.getElement(), "id", "my-button-id");
      addButton.addClickListener(new ClickListener() {
        public void onClick(Widget sender) {
          int x = addButton.getAbsoluteLeft();
          int y = addButton.getAbsoluteTop();
          addVocabulary(x, y + 20);
        }
      });
      hp.add(addButton);
    }
   
    layout.add(workingUrisPanel);
   
    refreshListWorkingUris();
  }
View Full Code Here


//    final SuggestBox box = new SuggestBox(oracle);
//    box.setWidth(width);
   
   
    CellPanel hp = new VerticalPanel();
    final MyDialog popup = new MyDialog(hp) {
      public boolean onKeyUpPreview(char key, int modifiers) {
        if ( key == KeyboardListener.KEY_ESCAPE ) {
          hide();
          return false;
        }
          return true;
        }
    };
    hp.add(new TLabel("Ontology URI:",
        "Select or enter the URL of the ontology you want to include in the list of working ontologies. " +
        "<br/>" +
        "As you type, URIs are displayed according to matching components in the " +
        "URI or the associated title."
    ));
   
//    hp.add(box);
//    box.addEventHandler(new SuggestionHandler() {
//      public void onSuggestionSelected(SuggestionEvent event) {
//        String suggestion = event.getSelectedSuggestion().getReplacementString();
//        RegisteredOntologyInfo ontologyInfo = suggestions.get(suggestion);
//        mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, ontologyInfo, popup);
//      }
//    });
   
    final TextBox textBox = createTextBox(suggestions, listBox, popup);
    textBox.setWidth(width);
    hp.add(textBox);
   
//    // we use the star (*) to show the whole list of vocabs. If the user enters something
//    // different, then remove the star:
//    box.addKeyboardListener(new KeyboardListener() {
//      public void onKeyPress(Widget sender, char keyCode, int modifiers) {
//        // FIXME: if the user wants to use the down arrow to pick a suggestion after
//        // entering *, it cannot do it!
//        if ( keyCode != '*' && box.getText().trim().equals("*") ) {
//          box.setText("");
//        }
//      }
//      public void onKeyDown(Widget sender, char keyCode, int modifiers) {}
//     
//      public void onKeyUp(Widget sender, char keyCode, int modifiers) {
//        if ( keyCode == KeyboardListener.KEY_ENTER ) {
//          String selectedUri = box.getText().trim();
//          Orr.log("addVocabulary: ENTER: '" + selectedUri + "'");
//          if (selectedUri.length() > 0) {
//            if ( VineMain.containsWorkingUri(selectedUri) ) {
//              // ignore the Enter
//              return;
//            }
//            BaseOntologyInfo ontologyInfo = VineMain.getOntologyInfo(selectedUri);
//            if (ontologyInfo instanceof RegisteredOntologyInfo) {
//              // It is a registered ontology -- load it as a working one:
//              RegisteredOntologyInfo roi = (RegisteredOntologyInfo) ontologyInfo;
//              mainPanel.notifyWorkingOntologyAdded(OntologySelection.this, roi, popup);
//            }
//            else {
//              // try as an external ontology:
//              OntologySelection.this.mainPanel.addExternalOntology(selectedUri, popup);
//            }
//          }
//        }       
//      }
//    });

    popup.setText("Select an ontology");
//    hp.add(new HTML("Elements are displayed as you type. Enter * to see the full list."));

    listBox.setWidth(width);
    listBox.setVisibleItemCount(Math.min(listBox.getItemCount() + 2, 12));
    hp.add(listBox);

//    listBox.addChangeListener(new ChangeListener () {
//      public void onChange(Widget sender) {
//        String value = listBox.getValue(listBox.getSelectedIndex());
//        RegisteredOntologyInfo ontologyInfo = suggestions.get(value);
View Full Code Here

    );
    row++;

   
    if ( INCLUDE_RDF ) {
      CellPanel resultPanel = new VerticalPanel();
      textArea.setReadOnly(true);
      textArea.setSize("400px", "100px");

      panel.getFlexCellFormatter().setColSpan(row, 0, 2);
      panel.setWidget(row, 0, resultPanel);

      DecoratorPanel decPanel = new DecoratorPanel();
      decPanel.setWidget(textArea);
      resultPanel.add(decPanel);
      row++;
    }

    return panel;
  }
View Full Code Here

      for ( int col = 0; col < vals.length; col++ ) {
        table.setWidget(lin+1, col, new Label(vals[col]));
      }
 
    }
    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("400");
    vp.setSpacing(10);
    vp.add(new HTML("This table shows an initial evaluation of the loaded ontology in relation " +
        "to the required MMI attributes. " +
        "It shows any included MMI attribute as well as those that are missing but " +
        "required. Use the Metadata section to edit all attributes as necessary."));
    vp.add(table);
    final MyDialog popup = new MyDialog(vp);
    popup.setText("Diagnostics on original metadata");
    popup.center();
    popup.show();
  }
View Full Code Here

    final String width = "500px";
   
    final ListBox listBox = OrrUtil.createListBox(options, cl);
    listBox.setWidth(width);
   
    VerticalPanel vp = new VerticalPanel();
   
    final MyDialog popup = new MyDialog(vp);
   
    listBox.setVisibleItemCount(Math.min(options.size(), 12));
    // make sure no item is selected so we get a change event on the first item (needed for firefox at least):
    // (see issue #139: Can't select AGU as authority abbreviation)
    listBox.setSelectedIndex(-1);

    listBox.addChangeListener(new ChangeListener () {
      public void onChange(Widget sender) {
        String value = listBox.getValue(listBox.getSelectedIndex());
        textBox.setText(value);
       
        Option option = options.get(listBox.getSelectedIndex());
        optionSelected(option);

        _onChange();

        popup.hide();
      }
    });
   
    /////////////////////////////////////////////////////////
    // Use a SuggestBox with a MultiWordSuggestOracle.
    //
    // A map from a suggestion to its corresponding Option:
    final Map<String,Option> suggestions = new HashMap<String,Option>();
    MultiWordSuggestOracle oracle = new MultiWordSuggestOracle("/ :-");
    for ( Option option : options ) {
      String suggestion = option.getName()+ " - " +option.getUri();
      suggestions.put(suggestion, option);
      oracle.add(suggestion);

    }
    final SuggestBox suggestBox = new SuggestBox(oracle);
    suggestBox.setWidth(width);
    suggestBox.addEventHandler(new SuggestionHandler() {
      public void onSuggestionSelected(SuggestionEvent event) {
        String suggestion = event.getSelectedSuggestion().getReplacementString();
        Option option = suggestions.get(suggestion);
        textBox.setText(option.getName());
        optionSelected(option);
       
        _onChange();
       
        popup.hide();
      }
    });
    // Fix to issue #245:"cannot find authority abbreviation after typing a few letters"
    // just set limit of the suggest box to the number of options
    suggestBox.setLimit(options.size());
    ////////////////////////////////////////////////////////////
   
    vp.add(suggestBox);
    vp.add(listBox);
   
    waitPopup.hide();
   
    // use a timer to request for focus in the suggest-box:
    new Timer() {
View Full Code Here

      });
    }
   
    this.setBorderWidth(1);
    VerticalPanel vp = new VerticalPanel();
    this.add(vp);
    vp.setSpacing(5);
   
    vp.add(resourceTypeFieldWithChoose);

    //////////////////////////////////////////////////////////////
    // handle the related attribute
    AttrDef attr2 = relatedAttrs.get(0);
    String label = attr2.getLabel();
    FlexTable panel = new FlexTable();
    int row = 0;
    int nl = attr2.getNumberOfLines();
    resourceTypeRelatedField = OrrUtil.createTextBoxBase(nl, "330", cl);
    String tooltip = "<b>" +label+ "</b>:<br/>" +
              attr2.getTooltip() +
              "<br/><br/><div align=\"right\">(" +attr2.getUri()+ ")</div>";
   
    TLabel tlabel = new TLabel(label, editing && attr2.isRequired(), tooltip);
   
    HorizontalPanel hpRelated = new HorizontalPanel();
    hpRelated.add(tlabel);
    hpRelated.add(resourceTypeRelatedField);
    panel.setWidget(row, 0, hpRelated);
   
//    panel.setWidget(row, 0, tlabel);
//    panel.setWidget(row, 0, resourceTypeRelatedField);
//    panel.getFlexCellFormatter().setWidth(row, 0, "250");
   
    panel.getFlexCellFormatter().setAlignment(row, 0,
        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
    );
//    panel.getFlexCellFormatter().setAlignment(row, 1,
//        HasHorizontalAlignment.ALIGN_LEFT, HasVerticalAlignment.ALIGN_MIDDLE
//    );
    row++;
    vp.add(panel);
    //////////////////////////////////////////////////////////////
   
    HorizontalPanel hp = new HorizontalPanel();
    vp.add(hp);
    hp.setSpacing(4);
    if ( includeIsMapCheck ) {
      hp.add(resourceTypeIsMap);
    }
   
View Full Code Here

        pctrl.setEntityPanel(null);

        controlsPanel.showMenuBar(interfaceType);
        headerPanel.updateLinks(interfaceType);
       
        VerticalPanel pan = new VerticalPanel();
        pan.setSpacing(20);
        pan.add(nfup);
        bodyPanel.add(pan);
      }
      });

View Full Code Here

        else if ( resolveUriResult.getError() != null ) {
          error = "<font color=\"red\">" +resolveUriResult.getError()+ "</font>";
        }
       
        if ( error != null ) {
          VerticalPanel vp = new VerticalPanel();
          vp.setSpacing(14);
          vp.add(new HTML(error));
          vp.add(new Hyperlink("Go to main page", PortalConsts.T_BROWSE));
          bodyPanel.clear();
            bodyPanel.add(vp);
            return;
        }
       
View Full Code Here

   
    String error = unregisterOntologyResult.getError();
   
    StringBuffer sb = new StringBuffer();
   
    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(6);
   
    if ( error == null ) {

      String uri = unregisterOntologyResult.getUri();
      String versionNumber = unregisterOntologyResult.getVersionNumber();

      vp.add(new HTML("The ontology has been unregistered. <br/>\n" +
          "<br/>\n" +
          "Ontology URI: " +uri+ "<br/>\n" +
          "Version: " +versionNumber+ "<br/>\n" +
          "\n"
      ));
     
      vp.add(new HTML("<br/>For diagnostics, this is the response from the back-end server:"));

      sb.append(unregisterOntologyResult.getInfo());
    }
    else {
      sb.append(error);
View Full Code Here

    if ( ontologyInfos == null || ontologyInfos.isEmpty() ) {
      Window.alert("Info about versions not available");
      return;
    }
   
    VerticalPanel vp = new VerticalPanel();
    vp.setSpacing(4);
    vp.setHorizontalAlignment(ALIGN_CENTER);

    final MyDialog popup = new MyDialog(vp);
    popup.setText("Available versions for " +oi.getUnversionedUri());
    IOntologyTable ontologyTable = OntologyTableCreator.create(PortalControl.getInstance().getQuickInfo(), true);
    ontologyTable.setIncludeVersionInLinks(true);
   
    final boolean sortDown = true; // (version, true) = most recent version first.
    ontologyTable.setSortColumn("version", sortDown)
   
    // this is to hide the popup when the user clicks one of the links:
    ontologyTable.addClickListenerToHyperlinks(
        new ClickListener() {
          public void onClick(Widget sender) {
            popup.hide();
          }
        }
    );
   
    vp.add(ontologyTable.getWidget());
   
    ontologyTable.setOntologyInfos(ontologyInfos, pctrl.getLoginResult());

    // close the popup if history changes:
    History.addHistoryListener(new HistoryListener() {
View Full Code Here

TOP

Related Classes of com.google.gwt.user.client.ui.VerticalPanel

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.