Ejemplo n.º 1
0
  /**
   * panel with a {@link #sensorOnOff "sensor-on-off" button}, a {@link #captionLabel label} with
   * the name of the sensor and a {@link #collapse button} to expand/collapse the settings for this
   * sensor. if sensor is turned off, it stops logging the data values of this sensor.
   */
  private void addCaption() {
    FlowPanel caption = new FlowPanel();
    caption.addStyleName("panelTitle");
    this.captionLabel = new Label();
    updateCaptionLabel();

    collapse =
        new ToggleButton(
            new Image(GuiResources.INSTANCE.collapse()), new Image(GuiResources.INSTANCE.expand()));
    collapse.addStyleName("collapse");
    collapse.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            dataValues.setVisible(!collapse.isDown());
          }
        });

    sensorOnOff = new SimplePanel();
    sensorON = new Image(AppResources.INSTANCE.shown());
    sensorOFF = new Image(AppResources.INSTANCE.hidden());
    sensorOnOff.add(sensorOFF);
    sensorOnOff.addStyleName("sensorOnOffButton");

    caption.add(sensorOnOff);
    caption.add(this.captionLabel);
    caption.add(collapse);
    this.add(caption);
  }
Ejemplo n.º 2
0
  /**
   * Sets the icon for this item using the given CSS classes.
   *
   * <p>
   *
   * @param iconClasses the CSS classes
   */
  public void setIcon(String iconClasses) {

    m_iconPanel.setVisible(true);
    Panel iconWidget = new SimplePanel();
    m_iconPanel.setWidget(iconWidget);
    iconWidget.addStyleName(iconClasses + " " + m_fixedIconClasses);
  }
  public AbstractSubTabTreeWidgetView(
      AbstractModelBoundTreeWidget modelBoundTreeWidget, EventBus eventBus) {
    this.eventBus = eventBus;
    this.modelBoundTreeWidget = modelBoundTreeWidget;
    this.table = new EntityModelCellTable<ListModel>(false, true);
    this.tree = modelBoundTreeWidget.getTree();

    initWidget(ViewUiBinder.uiBinder.createAndBindUi(this));

    headerTableContainer.add(table);
    treeContainer.add(tree);

    modelBoundTreeWidget
        .getModel()
        .getItemsChangedEvent()
        .addListener(
            new IEventListener() {
              @Override
              public void eventRaised(Event ev, Object sender, EventArgs args) {
                table.setRowData(new ArrayList<EntityModel>());
              }
            });

    actionPanel = createActionPanel(modelBoundTreeWidget.getModelProvider());
    if (actionPanel != null) {
      actionPanelContainer.add(actionPanel);
      actionPanel.addContextMenuHandler(tree);
    }

    updateStyles();
  }
 /**
  * Set the widget state to loading or not loading.
  *
  * @param loading is the chart loading?
  */
 public void setLoading(boolean loading) {
   if (loading) {
     mainPanel.setWidget(loadingImage);
   } else {
     mainPanel.setWidget(doneImage);
   }
 }
  /**
   * Creates new dialog.
   *
   * @param title the title for popup window
   * @param question the question that user must interact
   * @param handler the handler that call after user interact
   */
  public ProjectProblemDialog(String title, String question, final AskHandler handler) {
    this.handler = handler;
    setTitle(title);
    Widget widget = uiBinder.createAndBindUi(this);
    setWidget(widget);
    message.addStyleName(resources.centerPanelCss().label());
    message.getElement().setInnerHTML(question);

    Button configureButton =
        createButton(
            "Configure...",
            "problem-dialog-configure",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                handler.onConfigure();
                onClose();
              }
            });
    Button keepBlankButton =
        createButton(
            "Keep Blank",
            "problem-dialog-keepBlank",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                handler.onKeepBlank();
                onClose();
              }
            });
    configureButton.addStyleName(resources.centerPanelCss().blueButton());
    getFooter().add(configureButton);
    getFooter().add(keepBlankButton);
  }
Ejemplo n.º 6
0
 @Override
 protected void onUpdate() {
   cardSlotsWrapper.setWidget(createCardSlots());
   handCardsWrapper.setWidget(createHandCards());
   actionsWrapper.setWidget(createActions());
   super.onUpdate();
 }
 private void showMessagePopup() {
   Label validationMessageLabel = new Label();
   validationMessageLabel.setStyleName("validation-textbox-message-label"); // $NON-NLS-1$
   validationMessageLabel.setText(getValidationMessage());
   VerticalPanel messagePanel = new VerticalPanel();
   messagePanel.add(validationMessageLabel);
   HorizontalPanel bottomPanel = new HorizontalPanel();
   SimplePanel hSpacer = new SimplePanel();
   hSpacer.setStylePrimaryName("validation-textbox-left-image-buffer"); // $NON-NLS-1$
   bottomPanel.add(hSpacer);
   SimplePanel tailImagePanel = new SimplePanel();
   image = new Image(GWT.getModuleBaseURL() + "images/spacer.gif"); // $NON-NLS-1$
   image.setStylePrimaryName("validation-textbox-tail-image"); // $NON-NLS-1$
   tailImagePanel.add(image);
   bottomPanel.add(tailImagePanel);
   messagePanel.add(bottomPanel);
   popupPanel = new PopupPanel(true, false);
   popupPanel.setWidget(messagePanel);
   popupPanel.setPopupPositionAndShow(
       new PositionCallback() {
         public void setPosition(int offsetWidth, int offsetHeight) {
           int absLeft = -1;
           int absTop = -1;
           absLeft = textBox.getAbsoluteLeft();
           absTop = textBox.getAbsoluteTop();
           Rectangle popupSize = ElementUtils.getSize(popupPanel.getElement());
           popupPanel.setPopupPosition(
               absLeft, absTop - popupSize.height >= 0 ? absTop - popupSize.height : absTop);
         }
       });
   popupPanel.show();
 }
Ejemplo n.º 8
0
  @Override
  public void add(
      final WorkbenchPanelView newPanel,
      final WorkbenchPanelView targetPanel,
      final Integer preferredSize,
      final Integer preferredMinSize) {

    final Widget parent = targetPanel.asWidget().getParent();

    if (parent instanceof SimplePanel) {

      final SimplePanel sp = (SimplePanel) parent;
      final HorizontalSplitterPanel hsp =
          factory.newHorizontalSplitterPanel(
              newPanel, targetPanel, Position.EAST, preferredSize, preferredMinSize);

      sp.clear();
      sp.setWidget(hsp);

      // Adding an additional embedded ScrollPanel can cause scroll-bars to disappear
      // so ensure we set the sizes of the new Panel and it's children after the
      // browser has added the new DIVs to the HTML tree. This does occasionally
      // add slight flicker when adding a new Panel.
      scheduleResize(hsp);
    }
  }
Ejemplo n.º 9
0
  public void show(final Pair<Product, String> productPair) {
    this.product = productPair.getEntity1();
    if (null != product.getDescription()) description.setHTML(product.getDescription());
    else description.setText("");
    tags.setValues(product.getTags());
    name.setValue(product.getName());
    versionNumber.setValue(product.getVersionNumber());
    organization.setValue(product.getOrganizationName());
    webpageUrl.setValue(product.getWebsiteUrl());
    wikiUrl.setValue(product.getWikiUrl());
    downloadUrl.setValue(product.getDownloadUrl());
    showcaseUrl.setValue(product.getDemoUrl());
    forumUrl.setValue(product.getForumUrl());
    issueTrackerUrl.setValue(product.getIssueTrackerUrl());
    newsfeedUrl.setValue(product.getNewsUrl());
    WidgetUtil.selectValue(license.getComponent(), product.getLicense());
    WidgetUtil.selectValue(status.getComponent(), product.getStatus());
    WidgetUtil.selectValue(category.getComponent(), product.getCategoryId());
    new GetProductCategoriesCommand() {

      @Override
      public void onSuccess(ArrayList<Category> result) {
        WidgetUtil.selectValue(category.getComponent(), product.getCategoryId());
      }
    }.execute();
    resetIcon();
    uploaderContainer.clear();
    if (null != product && null != product.getId()) {
      uploaderContainer.add(new ProductImageUploadPanel(product, this));
    }
  }
Ejemplo n.º 10
0
  public void setAlgebraView(final AlgebraViewW av) {
    if (av != aview) {
      if (aview != null && simplep != null) {
        simplep.remove(aview);
        algebrap.remove(simplep);
      }

      simplep = new SimplePanel(aview = av);
      algebrap.add(simplep);
      simplep.addStyleName("algebraSimpleP");
      algebrap.addStyleName("algebraPanel");
      algebrap.addDomHandler(
          new ClickHandler() {

            public void onClick(ClickEvent event) {
              int bt = simplep.getAbsoluteTop() + simplep.getOffsetHeight();
              if (event.getClientY() > bt) {
                app.getSelectionManager().clearSelectedGeos();
                av.resetItems(true);
              }
              ;
            }
          },
          ClickEvent.getType());
    }
  }
Ejemplo n.º 11
0
  public DeviceUc(SimplePanel wrapperPanel, HeaderUc headerUc) {
    initWidget(uiBinder.createAndBindUi(this));
    this.headerUc = headerUc;
    this.wrapperPanel = wrapperPanel;

    androidSectiondiv.getElement().setId("pnlAndroidSectiondiv");
    ipadSectiondiv.getElement().setId("pnlIpadSectiondiv");

    msglinkPanel.getElement().setId("pnlMsglinkPanel");
    msgPanel.getElement().setId("pnlMsgPanel");
    closeAndriodBtn.getElement().setId("imgCloseAndriodBtn");

    closeIpadBtn.getElement().setId("imgCloseIpadBtn");
    gooruPanel.getElement().setId("pnlGooruPanel");
    ednovoPanel.getElement().setId("pnlEdnovoPanel");
    appstorePanel.getElement().setId("pnlAppstorePanel");
    viewAnchor.getElement().setId("lnkViewAnchor");

    setUiText();

    if (isIpad && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(true);
      androidSectiondiv.setVisible(false);
      ipadSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    } else if (isAndriod && !StringUtil.IPAD_MESSAGE_Close_Click) {
      ipadSectiondiv.setVisible(false);
      androidSectiondiv.setVisible(true);
      androidSectiondiv.getElement().setAttribute("style", "margin-top:-20px;");
      wrapperPanel.getElement().setAttribute("style", "margin-top:0px;");
      headerUc.getElement().getFirstChildElement().setAttribute("style", "position:relative;");
    }
  }
Ejemplo n.º 12
0
 public Tipsy() {
   initWidget(panel);
   panel.setStylePrimaryName(STYLE);
   panel.add(innerLabel);
   innerLabel.setStylePrimaryName(STYLE_INNER);
   //        RootPanel.get().add(this);
   //        this.setVisible(false);
 }
Ejemplo n.º 13
0
 protected final void loadDataFromServer() {
   asWidgetWrapper.clear();
   asWidgetWrapper.add(
       new BuilderPanel()
           .setStyleCard()
           .addWithPadding(Widgets.waitinfo("Daten werden abgerufen")));
   DataForClientLoaderHelper.load((DataForClientLoader) this);
 }
Ejemplo n.º 14
0
  /**
   * Sets the icon of this item.
   *
   * <p>
   *
   * @param image the image to use as icon
   */
  public void setIcon(Image image) {

    m_iconPanel.setVisible(true);
    if (image == null) {
      return;
    }
    m_iconPanel.setWidget(image);
  }
Ejemplo n.º 15
0
 public void setIconRight(Widget w) {
   iconHolderRight.setWidget(w);
   iconHolderRight.setVisible(w != null);
   if (w != null) {
     w.setSize("20px", "20px");
     GwtUtil.setStyles(w, "verticalAlign", "middle", "margin", "0");
   }
 }
Ejemplo n.º 16
0
  public PlayerWidget(String url) {
    SimplePanel panel = new SimplePanel(); // create panel to hold the player

    player = null;
    try {
      // create the player, specifing URL of media
      player = new WinMediaPlayer(url, true, "450px", "550px");
      player.showLogger(true);
      panel.setWidget(player); // add player to panel.
    } catch (LoadException e) {
      try {
        player = new QuickTimePlayer(url, true, "450px", "550px");
        panel.setWidget(player); // add player to panel.
        // catch loading exception and alert user
        Window.alert("An error occured while loading");
      } catch (LoadException ep) {
        try {
          player = new FlashMP3Player(url, true, "450px", "550px");
          panel.setWidget(player); // add player to panel.
          // catch loading exception and alert user
          Window.alert("An error occured while loading");
        } catch (LoadException exp) {
          // catch loading exception and alert user
          Window.alert("An error occured while loading");
        } catch (PluginVersionException exp) {
          // required plugin version is not available, alert user possibly providing a link
          // to the plugin download page.
          panel.setWidget(
              new HTML(".. some nice message telling the user to download plugin first .."));
        } catch (PluginNotFoundException exp) {
          // catch PluginNotFoundException and tell user to download plugin, possibly providing
          // a link to the plugin download page.
          panel.setWidget(
              new HTML(".. another nice message telling the user to download plugin.."));
        }
      } catch (PluginVersionException ep) {
        // required plugin version is not available, alert user possibly providing a link
        // to the plugin download page.
        panel.setWidget(
            new HTML(".. some nice message telling the user to download plugin first .."));
      } catch (PluginNotFoundException ep) {
        // catch PluginNotFoundException and tell user to download plugin, possibly providing
        // a link to the plugin download page.
        panel.setWidget(new HTML(".. another nice message telling the user to download plugin.."));
      }

    } catch (PluginVersionException e) {
      // required plugin version is not available, alert user possibly providing a link
      // to the plugin download page.
      panel.setWidget(
          new HTML(".. some nice message telling the user to download plugin first .."));
    } catch (PluginNotFoundException e) {
      // catch PluginNotFoundException and tell user to download plugin, possibly providing
      // a link to the plugin download page.
      panel.setWidget(new HTML(".. another nice message telling the user to download plugin.."));
    }
    initWidget(panel);
  }
Ejemplo n.º 17
0
 protected void doShowPortfolio(int portfolioId) {
   if (!isWidgetOfType(PortfolioDetailsWidget.class)) {
     LOGGER.info("view not portfolio details - creating new default portoflio details view");
     mainWidget.setWidget(new PortfolioDetailsWidget(portfolioId));
   } else {
     LOGGER.info("changing the portfoio id to " + portfolioId);
     ((PortfolioDetailsWidget) mainWidget.getWidget()).show(portfolioId);
   }
 }
Ejemplo n.º 18
0
 private SimplePanel horizontalWrapper(IsWidget child, String width) {
   SimplePanel wrapper = new SimplePanel(child.asWidget());
   wrapper.setStyleName("goon-horizontalWrapper");
   Style style = wrapper.getElement().getStyle();
   style.setProperty("display", "table-cell");
   if (childTextAlign != null) style.setTextAlign(childTextAlign);
   if (width != null) wrapper.setWidth(width);
   return wrapper;
 }
 public void setPresenter(Presenter presenter) {
   if (presenter.isEditing()) {
     editView.setPresenter(presenter);
     contentContainer.setWidget(editView);
   } else {
     displayView.setPresenter(presenter);
     contentContainer.setWidget(displayView);
   }
 }
Ejemplo n.º 20
0
  @Inject
  public MainView(IndexDisplayer indexDisplayer) {

    c.setStyleName("tab");
    c.addStyleName("first");
    p.setStyleName("tab");

    message.setStyleName("messageBar");
    message.setVisible(false);

    int i;
    for (i = 0; i < 5; i++) {
      startIndex.addItem(indexDisplayer.getDisplay(i), Integer.toString(i));
    }
    for (i = 5; i < 10; i++) {
      lastIndex.addItem(indexDisplayer.getDisplay(i), Integer.toString(i));
    }

    startIndex.setSelectedIndex(0);
    lastIndex.setSelectedIndex(0);

    HorizontalPanel hp = new HorizontalPanel();
    hp.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hp.add(new Label("Start Index: "));
    hp.add(startIndex);
    hp.add(new Label("End Index: "));
    hp.add(lastIndex);
    hp.setSpacing(5);

    bar.add(c);
    bar.add(p);
    bar.setStyleName("tabs");

    mainPanel = new VerticalPanel();
    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);
    clearHistory.setStyleName("link");
    mainPanel.add(clearHistory);

    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    mainPanel.add(hp);
    mainPanel.add(bar);
    mainPanel.add(message);
    mainPanel.add(bodyContainer);
    mainPanel.add(filter);
    mainPanel.add(filterActivate);
    mainPanel.add(filterModule);
    mainPanel.add(hasBeenThere);
    mainPanel.add(broadcastInfo);
    mainPanel.add(showStatus);
    mainPanel.add(activateStatus);
    wait.add(new Label("Wait"));

    initWidget(mainPanel);

    bodyContainer.setStyleName("body");
    bodyContainer.setWidget(new Label("Click on one of the tab to start."));
  }
Ejemplo n.º 21
0
  public void editBoard(
      Dtos.BoardWithProjectsDto boardWithProjects, List<Dtos.ProjectDto> allProjects) {
    if (projectToBoardAdding != null) {
      projectsToBoardAddingContainer.remove(projectToBoardAdding);
    }

    projectToBoardAdding = new ProjectsToBoardAdding(boardWithProjects, allProjects);
    projectsToBoardAddingContainer.add(projectToBoardAdding);
  }
Ejemplo n.º 22
0
 public void setWaitVisible(boolean visible) {
   if (visible) {
     wait.setPopupPosition(bodyContainer.getAbsoluteLeft(), bodyContainer.getAbsoluteTop());
     wait.setPixelSize(bodyContainer.getOffsetWidth(), bodyContainer.getOffsetHeight());
     wait.show();
   } else {
     wait.hide();
   }
 }
Ejemplo n.º 23
0
 @Override
 protected void onUpdate() {
   if (editor == null && editorWrapper.getWidget() != activateCommentLink) {
     editorWrapper.setWidget(activateCommentLink);
   } else if (editor != null && editorWrapper.getWidget() != editor) {
     editorWrapper.setWidget(editor);
   }
   updateCommentList();
   super.onUpdate();
 }
Ejemplo n.º 24
0
 @Override
 public void onSubmitComplete(SubmitCompleteEvent event) {
   String key = event.getResults();
   if (null != key && key.length() > 0) {
     product.setIconKey(key);
     resetIcon();
   }
   uploaderContainer.clear();
   uploaderContainer.add(new ProductImageUploadPanel(product, this));
 }
Ejemplo n.º 25
0
 @Override
 public void addToSlot(Object slot, Widget content) {
   if (content != null) {
     if (slot == EditFolderUiHandlers.TYPE_FOLDER_CONTENT_TAB) {
       collectionMetaDataSimPanel.setWidget(content);
     } else if (slot == EditFolderUiHandlers.TYPE_FOLDER_INFO_TAB) {
       collectionMetaDataSimPanel.setWidget(content);
     }
   }
 }
 @Override
 public void setPresenter(final Presenter presenter) {
   this.presenter = presenter;
   header.clear();
   header.add(headerWidget.asWidget());
   footer.clear();
   footer.add(footerWidget.asWidget());
   headerWidget.refresh();
   Window.scrollTo(0, 0); // scroll user to top of page
 }
Ejemplo n.º 27
0
 void onPersonSaved(@Observes PersonOperation po) {
   System.out.println("Person Saved  	" + po.toString());
   if (PersonOperationType.CREATE_SUCCESS.equals(po.getPersonOperationType())) {
     List<Person> persons = new ArrayList<Person>();
     persons.add(po.getSavedPerson());
     // personList.initPersonTable(persons);
     body.setWidget(personList);
   } else {
     body.setWidget(savePerson);
   }
 }
Ejemplo n.º 28
0
  /** Constructor. Pass null to prevent a value from being shown. */
  public ConnectionsPanel() {
    Label subheader = new Label("Connections");
    subheader.addStyleName("profile-subheader");
    this.add(subheader);

    this.add(contents);
    contents.addStyleName("connection-count-contents");

    SimplePanel simple = new SimplePanel();
    simple.addStyleName("clear");
    this.add(simple);
  }
Ejemplo n.º 29
0
 @Override
 protected void onUpdate() {
   TableBuilder tb = new TableBuilder();
   tb.setWidth(null);
   tb.setCellSpacing(5);
   for (Map.Entry<String, Integer> entry : dao.getEntityCounts().entrySet()) {
     tb.addRow(Gwt.createFieldLabel(entry.getKey()), new Label(String.valueOf(entry.getValue())));
   }
   entityCountWrapper.setWidget(tb.createTable());
   stateInformationWrapper.setWidget(createStateInformation());
   super.onUpdate();
 }
        public void onMouseDown(Widget sender, int x, int y) {
          float newPercent =
              (float) (x + lower.getOffsetWidth() + bar.getOffsetWidth())
                  / (float) base.getOffsetWidth();
          int newPosition =
              Math.round(
                      (target.getOffsetWidth() + target.getMaxHorizontalScrollPosition())
                          * newPercent)
                  - (target.getOffsetWidth() / 2);

          target.setHorizontalScrollPosition(newPosition);
        }