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

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


    // Cycle through the messages
    for (int i = 0; i < messages.size(); i++) {
      final Message m = messages.get(i);
      FreenetJs.log("REDRAWING MESSAGE:" + m.getMsg());
      // The panel which will hold the message
      HorizontalPanel hpanel = new HorizontalPanel();
      // Sets the background color based on the priority
      switch (m.getPriority()) {
        case MINOR:
          hpanel.getElement().getStyle().setProperty("background", "green");
          break;
        case WARNING:
          hpanel.getElement().getStyle().setProperty("background", "yellow");
          break;
        case ERROR:
          hpanel.getElement().getStyle().setProperty("background", "orange");
          break;
        case CRITICAL:
          hpanel.getElement().getStyle().setProperty("background", "red");
          break;
      }
      // Sets some css properties
      hpanel.getElement().getStyle().setProperty("width", "100%");
      hpanel.getElement().getStyle().setProperty("height", "100%");
      hpanel.getElement().getStyle().setProperty("display", "block");
      hpanel.getElement().getStyle().setPropertyPx("padding", 3);

      // The short description label
      Label msgLabel = new Label(m.getMsg());
      hpanel.add(msgLabel);
      msgLabel.getElement().getParentElement().getStyle().setProperty("border", "none");
      if (m.getAnchor() != null) {
        Anchor showElement = new Anchor(L10n.get("show"), "/alerts/#" + m.getAnchor());
        hpanel.add(showElement);
        showElement.getElement().getParentElement().getStyle().setProperty("border", "none");
      }

      if (m.isCanDismiss()) {
        // The hide link, it will hide the message if clicked on
        Anchor hideElement = new Anchor(L10n.get("hide"));
        hideElement.addMouseDownHandler(new MouseDownHandler() {
          @Override
          public void onMouseDown(MouseDownEvent event) {
            // Only send a request if the message is originated from the server
            if (m.getAnchor() != null) {
              FreenetRequest.sendRequest(UpdaterConstants.dismissAlertPath, new QueryParameter("anchor", m.getAnchor()), new RequestCallback() {
                @Override
                public void onResponseReceived(Request request, Response response) {
                  // When a response is got, the server is already removed the message. We can remove it too safely
                  removeMessage(m);
                }

                @Override
                public void onError(Request request, Throwable exception) {
                  // Don't do anything. If the server removed the message, it will push the change, if not, the user will try again
                }
              });
            } else {
              // If it is originated from the client, then simply hide it
              messages.remove(m);
              redrawMessages();
            }
          }
        });
        hpanel.add(hideElement);
        hideElement.getElement().getParentElement().getStyle().setProperty("border", "none");
      }

      // Adds the message to the panel
      messagesPanel.add(hpanel);
View Full Code Here


   * @param ontologySelection
   * @param ontologyInfo
   */
  void notifyWorkingOntologyAdded(final OntologySelection ontologySelection, RegisteredOntologyInfo ontologyInfo, final MyDialog popup) {
   
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(10);
   
    // TODO: why preloaded animated images don't animate? ...
    // (see http://groups.google.com/group/Google-Web-Toolkit-Contributors/browse_thread/thread/c6bc51da338262af)
//    hp.add(Main.images.loading().createImage());
    hp.add(new HTML(
      // ... workaround: insert it with img tag -- which does work, but that's not the idea
      "<img src=\"" +GWT.getModuleBaseURL()+ "images/loading.gif\">" +
      " Loading " +ontologyInfo.getUri()+
      " : <i>" +ontologyInfo.getDisplayLabel()+ "</i>" +
      "<br/>Please wait..."
View Full Code Here

  /**
   * Adds an external ontology to the working group.
   */
  void addExternalOntology(final String ontologyUri, final MyDialog popup) {
    HorizontalPanel hp = new HorizontalPanel();
    hp.setSpacing(10);
   
    hp.add(new HTML(
      "<img src=\"" +GWT.getModuleBaseURL()+ "images/loading.gif\">" +
      " Loading " +ontologyUri+
      "<br/>Please wait..."
    ));
    popup.setWidget(hp);
View Full Code Here

    }
      return true;
    }
 
  private CellPanel createButtons() {
    CellPanel panel = new HorizontalPanel();
    panel.setSpacing(2);

    closeButton = new PushButton("Close", new ClickListener() {
      public void onClick(Widget sender) {
        MyDialog.this.hide();
      }
    });
    panel.add(closeButton);

    return panel;
  }
View Full Code Here

  private CellPanel buttons = new HorizontalPanel();
 
 
  SearchVocabularySelection(int searchIndex) {
    super();
    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(ALIGN_MIDDLE);
    add(hp);

   
    hp.add(new TLabel("Search the following ontologies:",
        "Check the working ontologies you want to search. " +
        "Each found entity will be abbreviated by using the corresponding " +
        "ontology code given in the working ontologies section."
    ));
   
   
    hp.add(buttons);
   
    setToggleButtons(searchIndex);
   
  }
View Full Code Here

      protected void updateAllNone(boolean selected) {
        selectAll(selected);
      }
    };

    CellPanel hp = new HorizontalPanel();
    add(hp);
//    hp.setSpacing(5); 
    hp.setStylePrimaryName("MappingsTable-header");
    hp.setWidth("100%");
   
    hp.add(selAllNonePanel);
    hp.add(status);
    hp.setCellHorizontalAlignment(status, ALIGN_LEFT);
   
   
    CellPanel p = new VerticalPanel();
   
    DecoratorPanel decPanel = new DecoratorPanel();
View Full Code Here

   
    return panel;
  }
 
  private CellPanel createButtons() {
    CellPanel panel = new HorizontalPanel();
    panel.setSpacing(2);
    checkButton.setTitle("Checks that the given fields can be used to create a new URI in the repository");
    panel.add(checkButton);
   
    return panel;
  }
View Full Code Here

      _setSplitWidth100();
     
      DecoratorPanel decPanel = new DecoratorPanel();
      decPanel.setWidget(hSplit);
     
      HorizontalPanel hp = new HorizontalPanel();
//      hp.setBorderWidth(1);
      hp.setWidth("100%");
      hp.add(decPanel);
     
//      this.add(decPanel);
      this.add(hp);
  }
View Full Code Here

        "entered in the authority and class name fields will be used to complete the authority and shortName components. <br/>" +
        "<br/>" +
        "Use the \"Set\" button if you prefer different server/root values."
    );
   
    HorizontalPanel hp = this;
    hp.add(tlabel);
    hp.add(uriHtml);
    hp.add(userUriButton);
  }
View Full Code Here

    if ( row >= HEADER_ROW && col > CONTROL_COL ) {
      TableCell tcell = new TableCell(row, col, text, true);
      _setWidget(row, col, tcell);
    }
    else if ( row > CONTROL_ROW || col > CONTROL_COL ) {
      HorizontalPanel hp = new HorizontalPanel();
      hp.setWidth("100%");
//      hp.setBorderWidth(1);
      hp.setVerticalAlignment(ALIGN_MIDDLE);
      _setWidget(row, col, hp);
     
      if ( row > CONTROL_ROW ) {
        HTML html = new HTML(text);
        HTML filler = new HTML("");
       
        hp.setCellHorizontalAlignment(html, ALIGN_RIGHT);
       
//        if ( readOnly ) {
//          hp.add(html);
//          hp.add(filler);
//         
//          hp.setCellWidth(html, "80%");
//          hp.setCellWidth(filler, "20%");
//        }
//        else {
          Image img = _createMenu(row, col);
         
          hp.add(img);
          hp.add(html);
          hp.add(filler);
         
          hp.setCellWidth(img, "30%");
          hp.setCellWidth(html, "50%");
          hp.setCellWidth(filler, "20%");
         
          hp.setCellHorizontalAlignment(img, ALIGN_LEFT);
//        }
      }
      else { //if ( ! readOnly ) {
        Image img = _createMenu(row, col);
        hp.add(img);
      }
     
    }
    else if ( row == CONTROL_ROW && col == CONTROL_COL ) {
      HorizontalPanel hp = new HorizontalPanel();
      hp.setVerticalAlignment(ALIGN_MIDDLE);
      Image img = _createMenu(row, col);
      hp.add(img);
      if ( termsTLabel != null ) {
        hp.add(termsTLabel);
      }
      _setWidget(row, col, hp)
    }
    else {
      _setWidget(row, col, new HTML(text));
View Full Code Here

TOP

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

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.