Пример #1
0
  public CalendarCanvas() {
    VLayout mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();

    HLayout calendarLayout = new HLayout();
    calendarLayout.setWidth100();
    calendarLayout.setHeight100();

    NavigationView view = new NavigationView(NavigationView.VIEW_CALENDER);
    view.setWidth("25%");
    view.setShowResizeBar(true);
    view.setOverflow(Overflow.CLIP_H);

    VLayout addressListLayout = new VLayout();
    addressListLayout.addMember(new AddressFilterToolbar());

    HLayout addressHLayout = new HLayout();
    AddressList list = new AddressList();
    list.setWidth("220px");
    addressHLayout.addMember(list);
    addressHLayout.addMember(new AddressEditForm());
    addressListLayout.addMember(addressHLayout);

    calendarLayout.setMembers(view, addressListLayout);

    mainLayout.addMember(calendarLayout);
    addChild(mainLayout);
  }
Пример #2
0
  public SearchWindow() {
    super();

    i_searchListGrid = new SearchValueSetsListGrid();

    VLayout layout = new VLayout(5);

    setWidth100();
    setHeight100();
    setMargin(20);

    setTitle(TITLE);
    setShowMinimizeButton(false);
    setIsModal(true);
    setShowModalMask(true);
    setCanDragResize(true);
    centerInPage();

    addCloseClickHandler(
        new CloseClickHandler() {

          @Override
          public void onCloseClick(CloseClickEvent event) {
            destroy();
          }
        });

    layout.addMember(createDisplayLabel());
    layout.addMember(createSearchPanel());
    layout.addMember(getButtons());

    addItem(layout);

    createValueSetsReceivedEvent();
  }
Пример #3
0
  protected void setValues(Collection<V> values) {
    try {
      for (int i = 0; i < records.length; i++) {
        records[i].setVisible(false);
        viewPort.removeMember(records[i]);
      }
    } catch (Exception e) {
    }

    if (values.isEmpty()) {
      viewPort.addMember(records[0]);
      updateRecord(-1, records[0], null);
      records[0].show();
      return;
    }

    int i = 0;
    for (V value : values) {
      try {
        viewPort.addMember(records[i]);
        updateRecord(i, records[i], value);
        records[i].show();
        i++;
      } catch (Exception e) {
        SC.say(e.getMessage() + ":::;" + Integer.toString(i));
      }
    }
  }
  public Canvas getViewPanel() {
    VLayout layout = new VLayout();
    layout.setWidth100();
    layout.setHeight100();

    // Map with ID mapGeoTools is defined in the XML configuration. (mapGeoTools.xml)
    final MapWidget map = new MapWidget("mapGeoTools", "appGeoTools");
    // Select the layer, so we can also create features !
    map.getMapModel()
        .runWhenInitialized(
            new Runnable() {

              @Override
              public void run() {
                // select to create new features
                map.getMapModel().getLayer("clientLayerCountriesGeoTools").setSelected(true);
              }
            });

    // Set a panning controller on the map:
    map.setController(new PanController(map));
    // Create a tool-bar for this map:
    final Toolbar toolbar = new Toolbar(map);
    toolbar.setButtonSize(WidgetLayout.toolbarLargeButtonSize);

    layout.addMember(toolbar);
    layout.addMember(map);
    return layout;
  }
  public StyledLayerDescriptorLayoutView() {

    generalContentPanel = new VLayout();
    generalContentPanel.setWidth100();
    // minimal initial height
    generalContentPanel.setHeight(10);

    rulesContentPanel = new VLayout();
    rulesContentPanel.setWidth100();
    // take all the remaining space
    rulesContentPanel.setHeight("*");
    rulesContentPanel.setResizeBarTarget("next");
    rulesContentPanel.setShowResizeBar(true);

    ruleContentPanel = new VLayout();
    ruleContentPanel.setWidth100();
    // minimal initial height
    ruleContentPanel.setHeight(300);

    actionContentPanel = new VLayout();
    actionContentPanel.setWidth100();
    actionContentPanel.setHeight(10);

    widget = new VLayout();
    widget.setWidth100();
    widget.setHeight100();
    widget.setMembersMargin(5);
    widget.setMargin(5);
    widget.addMember(generalContentPanel);
    widget.addMember(rulesContentPanel);
    widget.addMember(ruleContentPanel);
    widget.addMember(actionContentPanel);
  }
Пример #6
0
  private VLayout createSearchPanel() {

    VLayout searchLayout = new VLayout();
    searchLayout.setWidth100();
    searchLayout.setHeight100();
    searchLayout.setLayoutMargin(10);
    searchLayout.setLayoutMargin(6);
    searchLayout.setMembersMargin(15);

    searchLayout.addMember(createSearchLayout());
    searchLayout.addMember(i_searchListGrid);

    i_searchListGrid
        .getField(SearchValueSetsListGrid.ID_ADD)
        .addCellSavedHandler(
            new CellSavedHandler() {
              @Override
              public void onCellSaved(CellSavedEvent event) {

                boolean hasRecordsToAdd = i_searchListGrid.hasAddRecords();
                i_addButton.setDisabled(!hasRecordsToAdd);
              }
            });

    return searchLayout;
  }
  public PositionsListeWidget() {
    this.setWidth("100%");
    this.setHeight("100%");

    links = UIFactory.getVLayout("70%", "500px");
    rechts = UIFactory.getVLayout("30%", "100%");
    this.setBackgroundColor("#CCFFCC");

    Positionsliste einkaufArtikel = new Positionsliste();
    Artikel neuerArtikel;
    try {
      neuerArtikel = Bauteil.erzeugeBauteil(20, 3, 2, "zweiterTyp", "schlecht");
      einkaufArtikel.erfassePosition(neuerArtikel, 500, 1000);
      neuerArtikel = Bauteil.erzeugeBauteil(20, 3, 2, "dritter", "schlecht");
      einkaufArtikel.erfassePosition(neuerArtikel, 500, 1000);
    } catch (InstanceCreationException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }

    einkaufsTabelle = new PositionsWidget();

    // Create a table to layout the form options
    FlexTable layout = new FlexTable();
    layout.setCellSpacing(6);
    FlexCellFormatter cellFormatter = layout.getFlexCellFormatter();

    // Add a title to the form
    layout.setHTML(0, 0, "Gesamtverbrauch");
    cellFormatter.setColSpan(0, 0, 2);
    cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);

    txtGesamtkosten = UIFactory.getStyledTextBox("TB1", true);
    txtLagerbedarf = UIFactory.getStyledTextBox("TB1", true);

    // Add some standard form options
    layout.setHTML(1, 0, "Gesamtkosten:");
    layout.setWidget(1, 1, txtGesamtkosten);
    layout.setHTML(2, 0, "Lagerbedarf:");
    layout.setWidget(2, 1, txtLagerbedarf);

    // Wrap the content in a DecoratorPanel
    //	    DecoratorPanel gesamt = new DecoratorPanel();
    Canvas gesamt = new Canvas();
    gesamt.setWidth("100%");
    //	    gesamt.setWidget(layout);
    gesamt.addChild(layout);

    auswahl = new AuswahlEinkaufWidget();

    // add Members to left and right side
    links.addMember(UIFactory.getStyledLabel("Einkaufsartikel", 30, 30));
    links.addMember(einkaufsTabelle);

    rechts.addMember(auswahl);
    rechts.addMember(gesamt);

    this.addMember(links);
    this.addMember(rechts);
  }
Пример #8
0
  private Layout() {

    vLayout = new VLayout();
    vLayout.setWidth100();
    vLayout.setHeight100();

    messageWindow = new MessageWindow(vLayout);

    vLayout.addMember(MainToolStrip.getInstance());

    mainSectionStack = new SectionStack();
    mainSectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    mainSectionStack.setAnimateSections(true);
    mainSectionStack.setCanResizeSections(true);

    SectionStackSection mainTabSection = new SectionStackSection();
    mainTabSection.setCanCollapse(false);
    mainTabSection.setShowHeader(false);

    centerTabSet = CenterTabSet.getInstance();
    mainTabSection.addItem(centerTabSet);

    mainSectionStack.setSections(mainTabSection);

    vLayout.addMember(mainSectionStack);

    modal = new ModalWindow(vLayout);

    vLayout.draw();
  }
Пример #9
0
  /** This is the entry point method. */
  public void onModuleLoad() {
    loading = new LoadingWindow();

    VLayout main = new VLayout();
    main.setWidth("100%");
    main.setHeight100();
    main.setAlign(Alignment.CENTER);

    Layout imgLayout = new Layout();
    content = new HLayout();
    content.setHeight100();

    Img header = new Img("GarsComLogo.jpg");
    header.setWidth(600);
    header.setHeight(130);
    header.setAlign(Alignment.CENTER);
    imgLayout.addMember(header);
    imgLayout.setWidth("100%");
    imgLayout.setAlign(Alignment.CENTER);

    main.addMember(imgLayout);
    main.addMember(content);

    Tabs tabs = new Tabs();
    content.addMember(tabs);

    main.draw();
  }
Пример #10
0
  public Canvas getViewPanel() {

    final TabSet topTabSet = new TabSet();
    topTabSet.setTabBarPosition(Side.TOP);
    topTabSet.setTabBarAlign(Side.LEFT);
    topTabSet.setWidth(400);
    topTabSet.setHeight(200);

    Tab tTab1 = new Tab("Blue", "pieces/16/pawn_blue.png");

    tTab1.setCanClose(true);
    Img tImg1 = new Img("pieces/48/pawn_blue.png", 48, 48);
    tTab1.setPane(tImg1);

    Tab tTab2 = new Tab("Green", "pieces/16/pawn_green.png");
    Img tImg2 = new Img("pieces/48/pawn_green.png", 48, 48);
    tTab2.setPane(tImg2);

    topTabSet.addTab(tTab1);
    topTabSet.addTab(tTab2);

    HLayout buttons = new HLayout();
    buttons.setMembersMargin(15);

    IButton addButton = new IButton("Add Tab");
    addButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            String title = topTabSet.getTabs().length % 2 == 0 ? "Yellow" : "Green";
            String iconType = topTabSet.getTabs().length % 2 == 0 ? "pawn" : "cube";
            Tab tTab = new Tab(title, "pieces/16/" + iconType + "_" + title.toLowerCase() + ".png");
            tTab.setCanClose(true);
            Img tImg =
                new Img("pieces/48/" + iconType + "_" + title.toLowerCase() + ".png", 48, 48);
            tTab.setPane(tImg);
            topTabSet.addTab(tTab);
          }
        });

    IButton removeButton = new IButton("Remove Tab");
    removeButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            topTabSet.removeTab(topTabSet.getTabs().length - 1);
          }
        });

    buttons.addMember(addButton);
    buttons.addMember(removeButton);

    VLayout vLayout = new VLayout();
    vLayout.setMembersMargin(15);
    vLayout.addMember(topTabSet);
    vLayout.addMember(buttons);
    vLayout.setHeight("auto");

    return vLayout;
  }
Пример #11
0
  private void initGUI(final GUIInfo info) {
    // Prepare a value manager that will include all forms spanned in each
    // tab
    vm = new ValuesManager();

    // Create all the tabs each one for a specific setup step
    tabs = new TabSet();
    tabs.setWidth(500);
    tabs.setHeight(250);

    Tab registrationTab = setupRegistration(vm);
    Tab repositoryTab = setupRepository(vm);
    Tab databaseTab = setupDatabase(vm);
    Tab languageTab = setupLanguage(vm);
    Tab smtpTab = setupSmtp(vm);
    tabs.setTabs(registrationTab, repositoryTab, databaseTab, languageTab, smtpTab);

    // This is the button used to confirm each step
    submit = new IButton();
    submit.setTitle(I18N.message("next"));
    submit.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onSubmit(info);
          }
        });

    // Prepare the heading panel with Logo and Title
    // Prepare the logo image to be shown inside the login form
    Label header = new Label(I18N.message("setup"));
    header.setStyleName("setupHeader");
    header.setIcon(Util.brandUrl("logo.png"));
    header.setIconWidth(205);
    header.setIconHeight(40);
    header.setHeight(45);

    // Prepare a panel to layout setup components
    VLayout layout = new VLayout();
    layout.setHeight(500);
    layout.setWidth(400);
    layout.setMembersMargin(5);
    layout.addMember(header);
    layout.addMember(tabs);
    layout.addMember(submit);

    // Panel for horizontal centering
    VLayout vPanel = new VLayout();
    vPanel.setDefaultLayoutAlign(Alignment.CENTER);
    vPanel.setWidth100();
    vPanel.setHeight(300);
    vPanel.addMember(layout);

    RootPanel.get().add(vPanel);

    // Remove the loading frame
    RootPanel.getBodyElement().removeChild(RootPanel.get("loadingWrapper").getElement());
  }
Пример #12
0
    private void reset(final UploadComponentOptions options) {
      resetComponents(options);
      clear();

      final Set<String> types = components.keySet();
      currentType = types.iterator().next();

      parentCanvas = new Canvas();
      layout = new VLayout();
      final SelectItem typeItem = new SelectItem("uploadType", "Upload Type");
      typeItem.setValueMap(types.toArray(new String[types.size()]));
      typeItem.setValue(currentType);
      typeItem.setWidth(250);
      typeItem.addChangedHandler(
          new ChangedHandler() {
            public void onChanged(final ChangedEvent event) {
              currentType = typeItem.getValue().toString();
              update();
            }
          });
      final Form form =
          new Form(
              DomConstants.buildConstant(DomConstants.UPLOAD_COMPONENT_TYPE, uploadComponentNumber),
              typeItem);
      form.setPadding(0);
      form.setMargin(0);
      form.setCellSpacing(0);
      form.setCellPadding(0);

      form.setAlign(Alignment.RIGHT);
      form.setWidth(350);
      form.setHeight(20);
      final HLayout header = new HLayout();
      header.setAlign(Alignment.RIGHT);
      header.addMember(form);
      header.setHeight(20);

      layout.setAlign(Alignment.RIGHT);
      layout.addMember(header);
      layout.addMember(parentCanvas);
      layout.setGroupTitle("File Chooser");
      layout.setIsGroup(true);
      layout.setHeight("185px");
      layout.setPadding(2);
      layout.setLayoutAlign(Alignment.CENTER);
      layout.setAlign(Alignment.CENTER);

      for (final UploadComponent uploadComponent : components.values()) {
        final Canvas childCanvas = uploadComponent.get();
        childCanvas.hide();
        parentCanvas.addChild(childCanvas);
      }
      update();
      wrapperLayout.addMember(layout);
    }
Пример #13
0
  public DigitalObjectTreeView(ClientMessages i18n) {
    this.i18n = i18n;
    this.i18nSmartGwt = ClientUtils.createSmartGwtMessages();
    treeSelector = createTreeSelector();

    VLayout vLayout = new VLayout();
    toolbar = createToolbar();
    vLayout.addMember(toolbar);
    vLayout.addMember(treeSelector);
    rootWidget = vLayout;
  }
  @Override
  public void attachToCanvas() {
    // remove all previous members, except crumbs
    for (int i = 1; i < canvas.getMembers().length; i++) {
      Canvas m = canvas.getMember(i);
      canvas.removeMember(m);
    }

    if (tabs.getTabs().length == 1) {
      Canvas c = tabs.getTabs()[0].getPane();
      c.setHeight100();
      canvas.addMember(c); // add the pane directly
    } else canvas.addMember(tabs);
  }
  public Layout build() {
    VLayout itemsViewLayout = new VLayout();

    if (this.hasToolBar) {
      Layout navTools = this.buildToolbar();
      itemsViewLayout.addMember(navTools);
    }

    Layout content = this.buildContent();
    itemsViewLayout.addMember(content);

    Layout paginationBar = this.buildPagination();
    itemsViewLayout.addMember(paginationBar);

    return itemsViewLayout;
  }
Пример #16
0
  /** @param sourceLayout */
  public void addSource(AbstractSourceLayout sourceLayout, boolean disabled) {

    if (disabled) {
      sourceLayout.setDisabled(true);
    }
    sourcesLayout.addMember(sourceLayout);
  }
Пример #17
0
 private void createExportMenu() {
   exportMenu = new VLayout();
   exportMenu.setLeft(exportButton.getAbsoluteLeft());
   exportMenu.setTop(30);
   exportMenu.setStyleName("n52_sensorweb_client_interactionmenu");
   exportMenu.setAutoHeight();
   exportMenu.setZIndex(1000000);
   exportMenu.addMember(createPDFLabel());
   exportMenu.addMember(createCSVLabel());
   exportMenu.setVisible(false);
 }
  protected Layout buildContent() {
    VLayout layout = new VLayout();
    this.buildGrid();

    this.loadingLabel = new Label("fetching " + this.itemName + "...");
    this.loadingLabel.setIcon("loading.gif");
    this.loadingLabel.setWidth100();
    this.loadingLabel.setHeight100();
    this.loadingLabel.setAlign(Alignment.CENTER);
    this.loadingLabel.hide();

    this.errorLabel = new Label("");
    this.errorLabel.setWidth100();
    this.errorLabel.setAlign(Alignment.CENTER);
    this.errorLabel.hide();

    layout.addMember(this.itemsGrid);
    layout.addMember(this.loadingLabel);
    layout.addMember(this.errorLabel);

    return layout;
  }
Пример #19
0
  private void initLayout() {
    headerView = new HeaderView();
    actionMenubarView = new ActionMenubarView();
    navigationView = new NavigationView();
    baseContainerView = BaseContainerView.getContainer();

    VLayout mainLayout = new VLayout();
    mainLayout.setCanSelectText(true);
    mainLayout.setStyleName("mainLayout");
    mainLayout.setWidth100();
    mainLayout.setHeight100();

    HLayout headerLayout = new HLayout();
    headerLayout.setWidth100();
    headerLayout.setHeight(UIConstants.HEADER_HEIGHT);
    headerLayout.addMember(headerView);
    mainLayout.addMember(headerLayout);

    HLayout centerLayout = new HLayout();

    navigationView.setShowResizeBar(true);
    centerLayout.addMember(navigationView);

    VLayout containerLayout = new VLayout();
    containerLayout.setBorder("1px solid #a1a1a1");
    containerLayout.setLayoutMargin(2);
    // containerLayout.addMember(actionMenubarView);
    containerLayout.addMember(baseContainerView);
    centerLayout.addMember(containerLayout);
    mainLayout.addMember(centerLayout);

    HLayout southLayout = new HLayout();
    southLayout.setWidth100();
    southLayout.setHeight(30);
    mainLayout.addMember(southLayout);

    initWidget(mainLayout);
  }
Пример #20
0
  public Canvas getViewPanel() {

    VLayout layout = new VLayout();
    layout.setMembersMargin(10);

    final Canvas cubeBin = new Canvas("cubeBin");
    cubeBin.setTop(40);
    cubeBin.setWidth(400);
    cubeBin.setHeight(300);
    cubeBin.setShowEdges(true);

    IButton button = new IButton();
    button.setTitle("Create");
    button.setIcon("pieces/16/cube_blue.png");
    button.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            final Img img = new Img();
            img.setLeft(Random.nextInt(340));
            img.setTop(Random.nextInt(240));
            img.setWidth(48);
            img.setHeight(48);
            img.setParentElement(cubeBin);
            img.setSrc("pieces/48/cube_blue.png");
            img.addClickHandler(
                new ClickHandler() {
                  public void onClick(ClickEvent event) {
                    img.destroy();
                  }
                });
            img.draw();
          }
        });
    layout.addMember(button);
    layout.addMember(cubeBin);

    return layout;
  }
  /**
   * Get view panel.
   *
   * @return The viewPanel Canvas
   */
  public Canvas getViewPanel() {
    VLayout layout = new VLayout(5);
    layout.setPadding(5);

    MapWidget mapWidget = new MapWidget("mapGuwWmsCountries", "appGuw");
    final RibbonTabLayout ribbon = new RibbonTabLayout(mapWidget, "appGuw", "guwRibbon1");
    ribbon.setSize("100%", "120px");

    ToolStrip toolStrip = new ToolStrip();
    toolStrip.setWidth100();
    ToolStripButton btn1 = new ToolStripButton("Toggle group title");
    btn1.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            ribbon.getRibbonBar(0).setShowGroupTitles(!ribbon.getRibbonBar(0).isShowGroupTitles());
          }
        });
    toolStrip.addButton(btn1);
    layout.addMember(toolStrip);
    layout.addMember(ribbon);
    layout.addMember(mapWidget);
    return layout;
  }
Пример #22
0
  /**
   * Constructor requires message text
   *
   * @param text
   */
  public ActionMessage(String text) {

    VLayout vLayout = new VLayout();
    vLayout.setShowEdges(false);

    vLayout.setWidth100();
    vLayout.setHeight100();

    vLayout.setMembersMargin(0);
    vLayout.setLayoutMargin(0);

    StringBuffer sb = new StringBuffer();

    sb.append(
        "<img style=\"margin:16px;margin-top:24px;margin-left:auto;margin-right:auto;display:block;\" ");
    sb.append("src=\"" + GuiStyles.LOADING_IMAGE + "\" width=\"64\" height=\"64\" />");

    sb.append(
        "<p style=\"font:normal 11px tahoma, arial, helvetica, sans-serif;color:"
            + GuiStyles.FONT_COLOR
            + ";text-align:center;\">"
            + text
            + "</p>");

    HTMLFlow flow = new HTMLFlow();
    flow.setContents(sb.toString());

    vLayout.addMember(flow);
    this.addItem(vLayout);

    this.setTitle(GUIGlobals.APP_TITLE);

    this.setShowCloseButton(false);
    this.setShowMinimizeButton(false);

    this.setBodyColor(GuiStyles.BG_COLOR);

    this.setWidth(240);
    this.setHeight(160);

    this.centerInPage();
    this.draw();
  }
Пример #23
0
  private Layout buildHeader() {
    HLayout header = new HLayout();
    header.setWidth100();
    header.setLayoutMargin(10);
    header.setBackgroundImage(GWT.getModuleBaseURL() + "admin/images/header_bg.png");

    LayoutSpacer sp = new LayoutSpacer();
    sp.setWidth(20);
    header.addMember(sp);
    header.addMember(buildLogo());
    header.addMember(new LayoutSpacer());

    VLayout userAndLocale = new VLayout();
    userAndLocale.setHeight100();
    userAndLocale.addMember(buildUserInfo());
    // userAndLocale.addMember(buildLocaleSelection());

    header.addMember(userAndLocale);
    return header;
  }
  public void build(DataSource entityDataSource, DataSource... additionalDataSources) {
    VLayout leftVerticalLayout = new VLayout();
    leftVerticalLayout.setID("staticFolderAssetsGridLayout");
    leftVerticalLayout.setHeight100();
    leftVerticalLayout.setWidth("40%");
    leftVerticalLayout.setShowResizeBar(true);

    listDisplay = new DynamicEntityListView(entityDataSource);
    listDisplay.getGrid().setHoverMoveWithMouse(true);
    listDisplay.getGrid().setCanHover(true);
    listDisplay.getGrid().setShowHover(true);
    listDisplay.getGrid().setHoverOpacity(75);
    listDisplay
        .getGrid()
        .setHoverCustomizer(
            new HoverCustomizer() {
              @Override
              public String hoverHTML(Object value, ListGridRecord record, int rowNum, int colNum) {
                if (record != null
                    && record.getAttribute("lockedFlag") != null
                    && record.getAttributeAsBoolean("lockedFlag")) {
                  return BLCMain.getMessageManager()
                      .replaceKeys(
                          BLCMain.getMessageManager().getString("lockedMessage"),
                          new String[] {"userName", "date"},
                          new String[] {
                            record.getAttribute("auditable.updatedBy.name"),
                            record.getAttribute("auditable.dateUpdated")
                          });
                }
                return null;
              }
            });

    leftVerticalLayout.addMember(listDisplay);

    dynamicFormDisplay = new DynamicFormView(entityDataSource);

    addMember(leftVerticalLayout);
    addMember(dynamicFormDisplay);
  }
Пример #25
0
  private VLayout createDisplayLabel() {
    String message =
        "Search for value sets.  Select the value sets by checking the checkbox and then click Add to add them.";
    i_label = new Label("<b>" + message + "<b>");
    i_label.setWidth100();
    i_label.setHeight(30);
    i_label.setMargin(2);
    i_label.setValign(VerticalAlignment.CENTER);
    i_label.setBackgroundColor(BACKGROUND_COLOR);

    final VLayout vLayoutLayoutSpacers = new VLayout();
    vLayoutLayoutSpacers.setWidth100();
    vLayoutLayoutSpacers.setHeight(30);
    vLayoutLayoutSpacers.setBackgroundColor(BACKGROUND_COLOR);
    vLayoutLayoutSpacers.setLayoutMargin(6);
    vLayoutLayoutSpacers.setMembersMargin(6);

    vLayoutLayoutSpacers.addMember(i_label);

    return vLayoutLayoutSpacers;
  }
Пример #26
0
  public Canvas getViewPanel() {

    VLayout layout = new VLayout();
    layout.setMembersMargin(10);

    final Img image = new Img("other/magnifier.png", 48, 48);
    image.setTop(125);
    image.setLeft(100);
    image.setAnimateTime(500); // milliseconds

    IButton zoomButton = new IButton();
    zoomButton.setTitle("Zoom");
    zoomButton.setLeft(40);
    zoomButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            image.animateRect(0, 50, 248, 248);
          }
        });

    IButton shrinkButton = new IButton();
    shrinkButton.setTitle("Shrink");
    shrinkButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            image.animateRect(100, 125, 48, 48);
          }
        });

    HLayout hLayout = new HLayout();
    hLayout.setMembersMargin(10);
    hLayout.addMember(zoomButton);
    hLayout.addMember(shrinkButton);
    layout.addMember(hLayout);

    layout.addChild(image);
    return layout;
  }
Пример #27
0
  public void build(DataSource entityDataSource, DataSource... additionalDataSources) {
    VLayout leftVerticalLayout = new VLayout();
    leftVerticalLayout.setID("customerLeftVerticalLayout");
    leftVerticalLayout.setHeight100();
    leftVerticalLayout.setWidth("50%");
    leftVerticalLayout.setShowResizeBar(true);

    listDisplay =
        new DynamicEntityListView(
            BLCMain.getMessageManager().getString("customerListTitle"),
            entityDataSource,
            false,
            false);
    leftVerticalLayout.addMember(listDisplay);

    dynamicFormDisplay =
        new DynamicFormView(
            BLCMain.getMessageManager().getString("customerDetailsTitle"), entityDataSource);
    dynamicFormDisplay.setWidth("50%");
    ToolStrip toolbar = dynamicFormDisplay.getToolbar();
    toolbar.addFill();
    Label label = new Label();
    label.setContents(BLCMain.getMessageManager().getString("resetPasswordPrompt"));
    label.setWrap(false);
    toolbar.addMember(label);

    updateLoginButton = new ToolStripButton();
    updateLoginButton.setIcon(
        GWT.getModuleBaseURL() + "sc/skins/Enterprise/images/headerIcons/settings.png");
    updateLoginButton.setDisabled(true);
    toolbar.addButton(updateLoginButton);
    toolbar.addSpacer(6);

    addMember(leftVerticalLayout);
    addMember(dynamicFormDisplay);
  }
  public Canvas getSearchCanvas() {
    final VLayout mainLayout = new VLayout(20);
    mainLayout.setWidth100();
    mainLayout.setHeight100();
    mainLayout.setPadding(5);

    Label titleBar = new Label(MESSAGES.geometricSearchWidgetFreeDrawingSearchTitle());
    titleBar.setBackgroundColor("#E0E9FF");
    titleBar.setWidth100();
    titleBar.setHeight(20);
    titleBar.setPadding(5);

    HLayout geomsButtonBar = new HLayout();
    geomsButtonBar.setWidth100();
    geomsButtonBar.setAutoHeight();
    geomsButtonBar.setMembersMargin(10);
    HLayout actionsButtonBar = new HLayout();
    actionsButtonBar.setWidth100();
    actionsButtonBar.setAutoHeight();
    actionsButtonBar.setMembersMargin(10);

    btnPoint = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingPoint());
    btnPoint.setIcon(WidgetLayout.iconPointCreate);
    btnPoint.setWidth(
        btnPoint.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnPoint.setActionType(SelectionType.RADIO);
    btnPoint.setRadioGroup("drawType");
    btnPoint.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawPoint();
          }
        });

    btnLine = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingLine());
    btnLine.setIcon(WidgetLayout.iconLineCreate);
    btnLine.setWidth(
        btnLine.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnLine.setActionType(SelectionType.RADIO);
    btnLine.setRadioGroup("drawType");
    btnLine.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawLine();
          }
        });

    btnPolygon = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingPolygon());
    btnPolygon.setIcon(WidgetLayout.iconPolygonCreate);
    btnPolygon.setWidth(
        btnPolygon.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnPolygon.setActionType(SelectionType.RADIO);
    btnPolygon.setRadioGroup("drawType");
    btnPolygon.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onDrawPolygon();
          }
        });

    btnUndo = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingUndo());
    btnUndo.setIcon(WidgetLayout.iconUndo);
    btnUndo.setWidth(
        btnUndo.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnUndo.setDisabled(true);
    btnUndo.setShowDisabledIcon(false);
    btnUndo.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onUndo();
          }
        });

    btnRedo = new IButton(MESSAGES.geometricSearchWidgetFreeDrawingRedo());
    btnRedo.setIcon(WidgetLayout.iconRedo);
    btnRedo.setWidth(
        btnRedo.getTitle().length() * GsfLayout.buttonFontWidth + GsfLayout.buttonOffset);
    btnRedo.setDisabled(true);
    btnRedo.setShowDisabledIcon(false);
    btnRedo.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            onRedo();
          }
        });

    frmBuffer = new DynamicForm();
    frmBuffer.setWidth100();
    spiBuffer = new SpinnerItem();
    spiBuffer.setTitle(MESSAGES.geometricSearchWidgetBufferLabel());
    spiBuffer.setDefaultValue(5);
    spiBuffer.setMin(0);
    spiBuffer.setWidth(60);
    spiBuffer.addChangedHandler(
        new ChangedHandler() {
          public void onChanged(ChangedEvent event) {
            updateView();
          }
        });
    frmBuffer.setFields(spiBuffer);

    // ----------------------------------------------------------

    geomsButtonBar.addMember(btnPoint);
    geomsButtonBar.addMember(btnLine);
    geomsButtonBar.addMember(btnPolygon);

    actionsButtonBar.addMember(btnUndo);
    actionsButtonBar.addMember(btnRedo);

    mainLayout.addMember(titleBar);
    mainLayout.addMember(geomsButtonBar);
    mainLayout.addMember(actionsButtonBar);
    mainLayout.addMember(frmBuffer);

    return mainLayout;
  }
  /** Instantiates a new digital object menu view. */
  @Inject
  public DigitalObjectMenuView(final LangConstants lang, final EventBus eventBus) {
    this.lang = lang;
    this.eventBus = eventBus;

    layout = new VLayout();

    layout.setHeight100();
    layout.setWidth100();
    layout.setOverflow(Overflow.AUTO);

    relatedGrid = new ListGrid();
    relatedGrid.setWidth100();
    relatedGrid.setHeight100();
    relatedGrid.setShowSortArrow(SortArrow.CORNER);
    relatedGrid.setShowAllRecords(true);
    relatedGrid.setAutoFetchData(false);
    relatedGrid.setCanHover(true);
    relatedGrid.setCanSort(false);
    ListGridField field1 = new ListGridField("relation", lang.relation());
    field1.setWidth("40%");
    ListGridField field2 = new ListGridField("uuid", "PID");
    field2.setWidth("*");
    relatedGrid.setFields(field1, field2);
    sectionRelated = new SectionStackSection();
    sectionRelated.setID(SECTION_RELATED_ID);
    sectionRelated.setTitle(lang.referencedBy());
    sectionRelated.setResizeable(true);
    sectionRelated.setItems(relatedGrid);
    sectionRelated.setExpanded(false);

    sideNavGrid =
        new ListGrid() {

          @Override
          protected Canvas getRollOverCanvas(Integer rowNum, Integer colNum) {
            final ListGridRecord rollOverRecord = this.getRecord(rowNum);
            if (rollOverCanvas == null) {
              rollOverCanvas = new HLayout();
              rollOverCanvas.setSnapTo("TR");
              rollOverCanvas.setWidth(50);
              rollOverCanvas.setHeight(22);
            }

            if (rollOverCanvas.getChildren().length > 0) {
              rollOverCanvas.removeChild(rollOverCanvas.getChildren()[0]);
            }
            final String lockOwner = rollOverRecord.getAttributeAsString(Constants.ATTR_LOCK_OWNER);
            if (lockOwner != null) {
              ImgButton lockImg = new ImgButton();
              lockImg.setShowDown(false);
              lockImg.setShowRollOver(false);
              lockImg.setLayoutAlign(Alignment.CENTER);

              if ("".equals(lockOwner)) {
                lockImg.setSrc("icons/16/lock_lock_all.png");
              } else if (lockOwner.length() > 0) {
                lockImg.setSrc("icons/16/lock_lock_all_red.png");
              }

              lockImg.setPrompt(lang.lockInfoButton());
              lockImg.setHeight(16);
              lockImg.setWidth(16);
              lockImg.addClickHandler(
                  new com.smartgwt.client.widgets.events.ClickHandler() {

                    @Override
                    public void onClick(com.smartgwt.client.widgets.events.ClickEvent event) {
                      EditorSC.objectIsLock(
                          lang,
                          new LockInfo(
                              lockOwner,
                              rollOverRecord.getAttributeAsString(Constants.ATTR_LOCK_DESCRIPTION),
                              rollOverRecord.getAttributeAsStringArray(
                                  Constants.ATTR_TIME_TO_EXP_LOCK)));
                    }
                  });
              rollOverCanvas.addChild(lockImg);
            }
            return rollOverCanvas;
          }
        };
    sideNavGrid.setShowSelectionCanvas(false);

    sideNavGrid.setWidth100();
    sideNavGrid.setHeight100();
    sideNavGrid.setShowSortArrow(SortArrow.CORNER);
    sideNavGrid.setShowAllRecords(true);
    sideNavGrid.setAutoFetchData(true);
    sideNavGrid.setCanHover(true);
    sideNavGrid.setHoverOpacity(75);
    sideNavGrid.setHoverStyle("interactImageHover");
    sideNavGrid.setShowRollOverCanvas(true);

    final DynamicForm form = new DynamicForm();
    form.setHeight(1);
    form.setWidth(60);
    form.setNumCols(1);

    selectItem.setWidth(60);
    selectItem.setShowTitle(false);
    selectItem.setValueMap(lang.me(), lang.all());
    selectItem.setDefaultValue(lang.me());
    selectItem.setHoverOpacity(75);
    selectItem.setHoverStyle("interactImageHover");
    selectItem.addItemHoverHandler(
        new ItemHoverHandler() {

          @Override
          public void onItemHover(ItemHoverEvent event) {
            selectItem.setPrompt(
                DigitalObjectMenuView.this.lang.showModifiedHint() + selectItem.getValue());
          }
        });
    selectItem.addChangedHandler(
        new ChangedHandler() {

          @Override
          public void onChanged(ChangedEvent event) {
            getUiHandlers().refreshRecentlyModified();
          }
        });

    form.setFields(selectItem);
    form.setTitle("by:");

    sectionRecentlyModified = new SectionStackSection();
    sectionRecentlyModified.setTitle(lang.recentlyModified());
    sectionRecentlyModified.setResizeable(true);
    sectionRecentlyModified.setItems(sideNavGrid);
    sectionRecentlyModified.setControls(form);
    sectionRecentlyModified.setExpanded(true);

    sectionStack = new SectionStack();
    sectionStack.addSection(sectionRelated);
    sectionStack.addSection(sectionRecentlyModified);
    sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE);
    sectionStack.setAnimateSections(true);
    sectionStack.setWidth100();
    sectionStack.setHeight100();
    sectionStack.setOverflow(Overflow.HIDDEN);
    layout.addMember(sectionStack);
  }
Пример #30
0
  public Layout getWindowLayout() {
    setWidth(500);
    setHeight(500);
    setTitle("Register");
    setShowMinimizeButton(false);
    setIsModal(true);
    setShowModalMask(true);
    setAutoCenter(true);
    setDismissOnOutsideClick(true);
    setShowShadow(true);
    setShadowOffset(0);
    setShadowSoftness(10);

    addCloseClickHandler(
        new CloseClickHandler() {
          public void onCloseClick(CloseClientEvent event) {
            destroy();
          }
        });

    Img profileImg =
        new Img(
            member.getProfilePic(),
            100,
            ImageUtil.getScaledImageHeight(member.getProfilePic(), 100));
    profileImg.setImageType(ImageStyle.STRETCH);

    HeaderItem header = new HeaderItem();
    header.setDefaultValue("Registration");
    emailItem.setValue(member.getEmail());
    emailItem.setRequired(true);
    firstNameItem.setValue(member.getFirstname());
    firstNameItem.setRequired(true);
    lastNameItem.setValue(member.getLastname());
    lastNameItem.setRequired(true);
    AWSSecretItem.setValue(member.getAWSSecretKey());
    AWSAccessItem.setValue(member.getAWSAccessKey());

    form.setFields(header, emailItem, firstNameItem, lastNameItem, AWSSecretItem, AWSAccessItem);
    form.setAutoFocus(true);

    HLayout buttons = new HLayout();
    buttons.setMembersMargin(15);
    buttons.setAlign(Alignment.CENTER);

    IButton cancelButton = new IButton("Cancel");
    cancelButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            destroy();
            // com.google.gwt.user.client.Window.Location.assign(GWT.getHostPageBaseURL());
          }
        });
    saveButton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            final LoginServiceAsync loginService = GWT.create(LoginService.class);
            loginService.memberExists(
                emailItem.getValueAsString(),
                new AsyncCallback<Boolean>() {

                  @Override
                  public void onFailure(Throwable caught) {
                    SC.say("Could not check if member already exists.");
                  }

                  @Override
                  public void onSuccess(Boolean result) {
                    emailItem.setValidators(new MemberExistsValidator(result));
                    if (form.validate()) {
                      member.setEmail(emailItem.getValueAsString());
                      member.setFirstname(firstNameItem.getValueAsString());
                      member.setLastname(lastNameItem.getValueAsString());
                      member.setAWSSecretKey(AWSSecretItem.getValueAsString());
                      member.setAWSAccessKey(AWSAccessItem.getValueAsString());

                      loginService.registerMember(
                          member,
                          new AsyncCallback<Member>() {

                            @Override
                            public void onSuccess(Member result) {
                              if (member != null) {
                                destroy();
                                com.google.gwt.user.client.Window.Location.assign(
                                    GWT.getHostPageBaseURL());
                              } else SC.warn("Email address already in use!");
                            }

                            @Override
                            public void onFailure(Throwable caught) {
                              if (caught instanceof MemberExistsException)
                                SC.warn("Email address already in use!");
                              else SC.warn("Something went wrong!");
                            }
                          });
                    }
                  }
                });
          }
        });

    buttons.addMember(saveButton);
    buttons.addMember(cancelButton);

    VLayout windowLayout = new VLayout();
    windowLayout.setMargin(10);
    windowLayout.setMembersMargin(15);
    windowLayout.addMember(profileImg);
    windowLayout.addMember(form);
    windowLayout.addMember(buttons);

    return windowLayout;
  }