/**
   * This method is called when GWT loads the Notes application (as defined in the Notes.gwt.xml).
   */
  public void onModuleLoad() {

    final HorizontalPanel mainpanel = new HorizontalPanel();

    final HTML displayTitle = new HTML("Existing Notes");
    displayTitle.setStyleName("displayTitle");
    final HTML entryTitle = new HTML("Create A Note");
    entryTitle.setStyleName("entryTitle");

    final VerticalPanel displayPanel = new VerticalPanel();
    displayPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    displayPanel.setStyleName("displayPanel");
    displayPanel.add(displayTitle);

    final VerticalPanel entryPanel = new VerticalPanel();
    entryPanel.setVerticalAlignment(VerticalPanel.ALIGN_TOP);
    entryPanel.setStyleName("entryPanel");
    entryPanel.add(entryTitle);

    displayPanel.add(notesPanel);

    final VerticalPanel form = createForm();
    entryPanel.add(form);

    mainpanel.add(displayPanel);
    mainpanel.add(entryPanel);

    RootPanel.get("notes").add(mainpanel);

    getNotes();
  }
Ejemplo n.º 2
0
  private VerticalPanel buildExtras() {

    HorizontalPanel extsBaseRow = new HorizontalPanel();

    ToggleButton bShowOnly = new ToggleButton(new Image("images/button_eye.gif"), this);
    bShowOnly.setTitle("Click to hide all route segments except this one! Click again to restore.");
    extsBaseRow.add(bShowOnly);

    soClick = new HTML("<div class=\"togglelink\">詳細內容</div>");
    soClick.setTitle("顯示詳細內容.");
    soClick.addClickListener(this);
    extsBaseRow.add(soClick);

    VerticalPanel exts = new VerticalPanel();
    exts.add(extsBaseRow);

    detailPanel = buildStopOvers();
    exts.add(detailPanel);

    exts.setStyleName("extras");
    extsBaseRow.setStyleName("base_row");
    bShowOnly.setStyleName("eye");
    detailPanel.setStyleName("stopovers");
    return exts;
  }
Ejemplo n.º 3
0
  public MainPanel() {
    super(Unit.PX);

    Image logoUfcg = new Image(Adicionais.RESOURCES.logoUfcg());
    Image logoAdicionais = new Image(Adicionais.RESOURCES.logoAdicionais());
    HorizontalPanel header = new HorizontalPanel();
    header.add(logoUfcg);
    header.setCellVerticalAlignment(logoUfcg, HasVerticalAlignment.ALIGN_MIDDLE);
    header.add(logoAdicionais);
    header.setCellHorizontalAlignment(logoAdicionais, HasHorizontalAlignment.ALIGN_RIGHT);
    header.setWidth("100%");
    header.setStyleName(Adicionais.RESOURCES.css().header());
    this.addNorth(header, 88);

    VerticalPanel footer = new VerticalPanel();
    Label developersLabel =
        new Label("Desenvolvido por Cleber Gonçalves de Sousa e Vitor Morato Almeida");
    developersLabel.setStyleName(Adicionais.RESOURCES.css().developers());
    footer.add(developersLabel);

    this.addSouth(footer, 23);
    footer.setWidth("100%");
    footer.setStyleName(Adicionais.RESOURCES.css().footer());

    this.contentArea = new SimplePanel();
    this.contentArea.setStyleName(Adicionais.RESOURCES.css().content());
    this.add(this.contentArea);
  }
  public IndicatorWidget(ProjectMediator med) {
    this.med = med;

    name_lbl = new Label();
    author_lbl = new Label();
    description_lbl = new Label();
    version_lbl = new Label();
    activated_btn = new Button();
    setActivated(false);
    activated_btn.addClickHandler(this);

    labelPanel.setStyleName("indicatorInfoPanel");
    labelPanel.add(name_lbl);
    labelPanel.add(author_lbl);
    labelPanel.add(version_lbl);
    labelPanel.add(description_lbl);
    labelPanel.add(activated_btn);

    name_lbl.addStyleName("indicatorInfoTitle");
    author_lbl.addStyleName("indicatorInfoStage");
    version_lbl.addStyleName("indicatorInfoStage");
    description_lbl.addStyleName("indicatorInfoDescription");

    mainPanel.setWidget(0, 0, labelPanel);
    initWidget(mainPanel);
  }
Ejemplo n.º 5
0
  private VerticalPanel getPanel() {
    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("StudioPopup");

    VerticalPanel info = new VerticalPanel();
    info.setSpacing(10);

    Label lbl = new Label();
    lbl.setStyleName("StudioPopup-Msg-Strong");
    lbl.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    lbl.setText("Add Value");

    Label lblName = new Label();
    lblName.setStyleName("StudioPopup-Msg");
    lblName.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    lblName.setText("Value");

    enumValue = new TextBox();
    enumValue.setWidth("155px");

    HorizontalPanel namePanel = new HorizontalPanel();
    namePanel.setSpacing(10);
    namePanel.add(lblName);
    namePanel.add(enumValue);
    namePanel.setCellVerticalAlignment(lblName, HasVerticalAlignment.ALIGN_MIDDLE);

    info.add(lbl);
    info.add(namePanel);

    panel.add(info);
    panel.add(getButtonPanel());

    return panel;
  }
  public PainelPesquisarView() {
    hpPainelPesquisar = new HorizontalPanel();
    hpPainelPesquisar.setStyleName("hpPainelPesquisar");

    tbPesquisar = new TextBox();
    tbPesquisar.setStyleName("tbPesquisar");

    btnPesquisar = new Button("");
    btnPesquisar.setStyleName("btnPesquisar");

    hpPainelPesquisar.add(tbPesquisar);
    hpPainelPesquisar.add(btnPesquisar);
    hpPainelPesquisar.setCellWidth(tbPesquisar, "38%");

    hpPainelLabelContatos = new HorizontalPanel();
    hpPainelLabelContatos.setStyleName("hpPainelLabelContatos");

    lbContatos = new Label("Contatos");
    lbContatos.setStyleName("lbContatos");

    hpPainelLabelContatos.add(lbContatos);
    hpPainelLabelContatos.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
    hpPainelLabelContatos.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);

    vpPainelPesquisar = new VerticalPanel();
    vpPainelPesquisar.setStyleName("vpPainelPesquisar");

    vpPainelPesquisar.add(hpPainelPesquisar);
    vpPainelPesquisar.add(hpPainelLabelContatos);

    initWidget(vpPainelPesquisar);
  }
Ejemplo n.º 7
0
    public Widget asWidget() {

      VerticalPanel formPanel = new VerticalPanel();
      formPanel.setStyleName("fill-layout-width");
      formPanel.add(getHelp().asWidget());
      formPanel.add(getForm().asWidget());
      return formPanel;
    }
Ejemplo n.º 8
0
    public SingletonDialog(Set<String> singletonTypes, final SimpleCallback callback) {
      super(Console.CONSTANTS.selectResourceType());

      // Create a CellList that uses the cell.
      cellList =
          new CellList<String>(
              new TextCell() {
                @Override
                public void render(Context context, String data, SafeHtmlBuilder sb) {
                  String cssName =
                      (context.getIndex() % 2 > 0)
                          ? "combobox-item combobox-item-odd"
                          : "combobox-item";

                  if (data.equals(selectionModel.getSelectedObject()))
                    cssName += " combobox-item-selected";

                  sb.append(TEMPLATE.item(cssName, data));
                }
              });

      cellList.setStyleName("fill-layout-width");
      selectionModel = new SingleSelectionModel<String>();

      cellList.setSelectionModel(selectionModel);
      cellList.setRowCount(singletonTypes.size(), true);
      ArrayList<String> values = new ArrayList<String>(singletonTypes);
      cellList.setRowData(0, values);

      selectionModel.setSelected(values.get(0), true);

      VerticalPanel panel = new VerticalPanel();
      panel.setStyleName("fill-layout-width");
      panel.add(cellList.asWidget());
      Widget widget =
          new WindowContentBuilder(
                  panel,
                  new DialogueOptions(
                      Console.CONSTANTS.common_label_continue(),
                      new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {

                          SingletonDialog.this.hide();
                          callback.onSuccess(selectionModel.getSelectedObject());
                        }
                      },
                      Console.CONSTANTS.common_label_cancel(),
                      new ClickHandler() {
                        @Override
                        public void onClick(ClickEvent event) {
                          SingletonDialog.this.hide();
                        }
                      }))
              .build();

      setWidget(widget);
    }
Ejemplo n.º 9
0
 private VerticalPanel discriptionPanel() {
   VerticalPanel discriptionPanel = new VerticalPanel();
   discriptionPanel.setStyleName("pannel-Border");
   discriptionPanel.setWidth("100%");
   Label discriptionLabel =
       new Label(
           "This application supports annotations of Virtual Physiological Human data and models (VPHDM)s.");
   discriptionPanel.add(discriptionLabel);
   return discriptionPanel;
 }
Ejemplo n.º 10
0
  Widget asWidget() {
    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("fill-layout");

    form =
        new Form<TransactionManager>(TransactionManager.class) {
          @Override
          public FormValidation validate() {
            return validateTx(super.validate());
          }
        };
    form.setNumColumns(2);

    FormToolStrip<TransactionManager> toolstrip =
        new FormToolStrip<TransactionManager>(
            form,
            new FormToolStrip.FormCallback<TransactionManager>() {
              @Override
              public void onSave(Map<String, Object> changeset) {
                presenter.onSaveConfig(changeset);
              }

              @Override
              public void onDelete(TransactionManager entity) {}
            });
    toolstrip.providesDeleteOp(false);

    FormHelpPanel helpPanel =
        new FormHelpPanel(
            new FormHelpPanel.AddressCallback() {
              @Override
              public ModelNode getAddress() {
                ModelNode address = Baseadress.get();
                address.add("subsystem", "transactions");
                return address;
              }
            },
            form);
    layout.add(helpPanel.asWidget());

    formValidationError = new Label("Form is invalid!");
    formValidationError.addStyleName("form-error-desc");
    formValidationError.getElement().getStyle().setLineHeight(9, PX);
    formValidationError.getElement().getStyle().setMarginBottom(5, PX);
    formValidationError.setVisible(false);
    layout.add(formValidationError.asWidget());

    form.setFields(fields);
    form.setEnabled(false);

    layout.add(form.asWidget());

    return layout;
  }
Ejemplo n.º 11
0
  @Override
  protected Widget createMainWidget() {
    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName(ThemeStyles.INSTANCE.fileUploadPanel());

    // directory panel
    HorizontalPanel directoryPanel = new HorizontalPanel();
    directoryPanel.setWidth("100%");
    directoryPanel.setStyleName(ThemeStyles.INSTANCE.fileUploadField());

    // directory name (informational field)
    panel.add(new Label("Target directory:"));
    directoryNameWidget_ = new DirectoryNameWidget();
    directoryNameWidget_.setDirectory(targetDirectory_);
    directoryPanel.add(directoryNameWidget_);

    // browse directory button
    // JJA: removed browse button (was causing confusion for users who
    // thought it was what they should press to browse local files)
    /*
    Button browseButton = new Button("Browse...",
                                     new BrowseDirectoryClickHandler());
    browseButton.getElement().getStyle().setMarginRight(5, Unit.PX);
    directoryPanel.add(browseButton);
    directoryPanel.setCellHorizontalAlignment(
                                        browseButton,
                                        HasHorizontalAlignment.ALIGN_RIGHT);
    */
    panel.add(directoryPanel);

    // filename field
    panel.add(new Label("File to upload:"));
    fileUpload_ = new FileUpload();
    fileUpload_.setStyleName(ThemeStyles.INSTANCE.fileUploadField());
    fileUpload_.setName("file");
    panel.add(fileUpload_);

    // zip file tip field
    HTML tip =
        new HTML(
            "<b>TIP</b>: To upload multiple files or a "
                + "directory, create a zip file. The zip file will "
                + "be automatically expanded after upload.");
    tip.addStyleName(ThemeStyles.INSTANCE.fileUploadField());
    tip.addStyleName(ThemeStyles.INSTANCE.fileUploadTipLabel());
    panel.add(tip);

    // target directory hidden field
    targetDirectoryHidden_ = new Hidden("targetDirectory", targetDirectory_.getPath());
    panel.add(targetDirectoryHidden_);

    return panel;
  }
Ejemplo n.º 12
0
 public void drawSecretNotify(boolean bol, int error) {
   pSecretError.clear();
   if (bol == true) {
     pSecret.setStyleName("core-CreateUserAccount-ErrorInput");
     if (error > 0) {
       pSecretError.add(new HTML(UserData.getError(error)));
     }
   } else {
     pSecret.removeStyleName("core-CreateUserAccount-ErrorInput");
     pSecretError.clear();
   }
 }
Ejemplo n.º 13
0
  public InputsPanel(InputsListPanel parent, Input2 input) {
    this.input = input;
    this.parent = parent;
    mainPanel = new VerticalPanel();
    mainPanel.setStyleName("inputsBordered");
    mainPanel.setSpacing(2);
    mainPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    initWidget(mainPanel);
    mainPanel.setWidth("258px");

    createLayout();
  }
  public ContainerBuilderWidget() {
    this.setModal(false);
    this.setAutoHideEnabled(false);
    this.setAnimationEnabled(true);
    this.setPopupPosition(10, Window.getScrollTop() + 10);
    this.setText(constants.windowTitle());
    this.addStyleName("builder");

    builderContent = new VerticalPanel();
    this.add(builderContent);
    builderContent.setWidth("200px");
    builderContent.setStyleName("builder");
  }
Ejemplo n.º 15
0
  public Widget build() {

    if (null == form) throw new IllegalStateException("form not set");

    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("fill-layout-width");

    if (tools != null) layout.add(tools.asWidget());
    if (help != null) layout.add(help.asWidget());
    layout.add(form.asWidget());

    return layout;
  }
Ejemplo n.º 16
0
  protected Widget buildFormPanel(
      final ResourceDescription definition,
      SecurityContext securityContext,
      boolean enableFormEdit) {
    final ModelNodeFormBuilder.FormAssets formAssets =
        new ModelNodeFormBuilder()
            .setConfigOnly()
            .setResourceDescription(definition)
            .setSecurityContext(securityContext)
            .build();
    if (enableFormEdit) {
      formAssets
          .getForm()
          .setToolsCallback(
              new FormCallback() {
                @Override
                public void onSave(Map changeSet) {
                  IOPanel.this.onModify(
                      selectionModel.getSelectedObject().getName(),
                      formAssets.getForm().getChangedValues());
                }

                @Override
                public void onCancel(Object entity) {
                  formAssets.getForm().cancel();
                }
              });
    }

    selectionModel.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {
          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            Property worker = selectionModel.getSelectedObject();
            if (worker != null) {
              formAssets.getForm().edit(worker.getValue());
            } else {
              formAssets.getForm().clearValues();
            }
          }
        });

    VerticalPanel formPanel = new VerticalPanel();
    formPanel.setStyleName("fill-layout-width");
    formPanel.add(formAssets.getHelp().asWidget());
    formPanel.add(formAssets.getForm().asWidget());

    return formPanel;
  }
Ejemplo n.º 17
0
  private VerticalPanel createSearchPanel() {
    VerticalPanel searchPanel = new VerticalPanel();
    searchPanel.setStyleName("pannel-Border");
    searchPanel.setWidth("100%");

    searchTable.getColumnFormatter().setWidth(0, "150em");
    searchTable.setWidget(0, 0, new Label("Model url"));
    searchTable.setWidget(0, 1, modelText);
    modelText.setWidth("400");

    searchTable.setWidget(1, 1, createButtonPanel());
    searchPanel.add(searchTable);

    return searchPanel;
  }
  /** @return the control. */
  public Widget asWidget() {
    Column<?> containerTotalCountItem =
        new NumberColumn("ContainerTotalCount", "Total Count").setVisible(false);
    Column<?> totalCountItem = new NumberColumn("TotalCount", "Total Count").setBaseline(true);
    Column<?> successCountItem =
        new NumberColumn("SuccessCount", "Success Count").setComparisonColumn(totalCountItem);
    Column<?> faultCountItem =
        new NumberColumn("FaultCount", "Fault Count").setComparisonColumn(totalCountItem);
    if (_displaysChildMetrics) {
      totalCountItem.setComparisonColumn(containerTotalCountItem);
    }

    // XXX: these should really be "LongColumn"
    Column<?> containerTotalProcessingTime =
        new NumberColumn("ContainerTotalProcessingTime", "Total Processing Time")
            .setVisible(false)
            .setBaseline(true);
    Column<?> totalProcessingTimeItem =
        new NumberColumn("TotalProcessingTime", "Total Processing Time");
    if (_displaysChildMetrics) {
      totalProcessingTimeItem.setComparisonColumn(containerTotalProcessingTime);
    }

    // XXX: using TextColumn for long and double fields
    Column<?> averageProcessingTimeItem =
        new TextColumn("AverageProcessingTime", "Average Processing Time");
    Column<?> minProcessingTimeItem = new TextColumn("MinProcessingTime", "Min. Processing Time");
    Column<?> maxProcessingTimeItem = new TextColumn("MaxProcessingTime", "Max. Processing Time");

    _messageCounts = new PlainColumnView("Message Counts");
    _messageCounts.setColumns(
        containerTotalCountItem, totalCountItem, successCountItem, faultCountItem);

    _processingTimes = new PlainColumnView("Processing Times");
    _processingTimes.setColumns(
        containerTotalProcessingTime,
        totalProcessingTimeItem,
        averageProcessingTimeItem,
        minProcessingTimeItem,
        maxProcessingTimeItem);

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("fill-layout-width");

    panel.add(_messageCounts.asWidget());
    panel.add(_processingTimes.asWidget());
    return panel;
  }
Ejemplo n.º 19
0
  public LHSServerGroupNavigation() {

    layout = new LayoutPanel();
    layout.setStyleName("fill-layout");

    stack = new VerticalPanel();
    stack.setStyleName("fill-layout-width");

    serverGroupSection = new ServerGroupSection();
    stack.add(serverGroupSection.asWidget());

    DeploymentSection deploymentSection = new DeploymentSection();
    stack.add(deploymentSection.asWidget());

    layout.add(stack);
  }
Ejemplo n.º 20
0
  public SubsystemSection() {

    LHSNavTree navigation = new LHSNavTree("profiles");
    navigation.getElement().setAttribute("aria-label", "Profile Tasks");

    subsysTree = new LHSTreeSection(Console.CONSTANTS.common_label_subsystems());
    navigation.addItem(subsysTree);

    layout = new VerticalPanel();
    layout.setStyleName("fill-layout-width");

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

    profileSelector = new ProfileSelector();
    Widget selectorWidget = profileSelector.asWidget();
    layout.add(selectorWidget);

    layout.add(navigation);
  }
Ejemplo n.º 21
0
  @Override
  public Widget createWidget() {
    container.setStyleName("fill-layout");

    OneToOneLayout panel =
        new OneToOneLayout()
            .setTitle("JSM Policy")
            .setHeadline("JSM Policy of the server")
            .setDescription("Java Security Manager policy file used on this server.")
            .setMaster("Policy of the server", container);

    textBoxName.setReadOnly(true);
    container.add(textBoxName);

    textAreaContent.setReadOnly(true);
    textAreaContent.setHeight("200px");
    container.add(textAreaContent);

    return panel.build();
  }
Ejemplo n.º 22
0
  public Widget asWidget() {

    DockLayoutPanel wrapper = new DockLayoutPanel(Style.Unit.PX);

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("window-content");

    final Form<PropertyRecord> form = new Form<PropertyRecord>(PropertyRecord.class);

    TextBoxItem nameItem = new TextBoxItem("key", "Name");
    TextBoxItem valueItem = new TextBoxItem("value", "Value");
    CheckBoxItem bootItem = new CheckBoxItem("bootTime", "Boot-Time");

    if (Console.MODULES.getBootstrapContext().isStandalone() || !includeBootTime)
      form.setFields(nameItem, valueItem);
    else form.setFields(nameItem, valueItem, bootItem);

    DialogueOptions options =
        new DialogueOptions(
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // save
                PropertyRecord property = form.getUpdatedEntity();
                presenter.onCreateProperty(reference, property);
              }
            },
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                // cancel
                presenter.closePropertyDialoge();
              }
            });

    panel.add(form.asWidget());

    wrapper.addSouth(options, 35);
    wrapper.add(panel);
    return wrapper;
  }
  /** Configures a flex table and corresponding titles to add to the overall layout. */
  private VerticalPanel addToPanel(
      String sectionText, final FlexTable table, final boolean isAsset) {
    VerticalPanel layout = new VerticalPanel();
    layout.setWidth("60%");
    layout.setStyleName("asset-step-layout");
    layout.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_RIGHT);

    table.setWidth("100%");
    FlexCellFormatter formatter = table.getFlexCellFormatter();
    formatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_LEFT);

    // Adding the section headings for the table
    Label sectionLabel = new Label(sectionText);
    sectionLabel.setStyleName("square-title");
    table.setWidget(0, 0, sectionLabel);

    if (table.getRowCount() == 0) {
      this.addRowToTable("", null, -1, table, isAsset); // initially blank
    }

    Button newRowButton = null;
    if (isAsset) {
      newRowButton = new Button(messages.addAssetButton());
    } else {
      newRowButton = new Button(messages.addSecuritySubGoal());
    }

    newRowButton.setWidth("180px");

    newRowButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            addRowToTable("", null, new Integer(-1), table, isAsset);
          }
        });

    layout.add(table);
    layout.add(newRowButton);

    return layout;
  }
Ejemplo n.º 24
0
  public Widget asWidget() {

    VerticalPanel layout = new VerticalPanel();
    layout.getElement().setId("profile_selection");
    layout.getElement().setAttribute("title", "Please chose a configuration profile");
    layout.setStyleName("fill-layout-width");
    layout.addStyleName("lhs-selector");
    layout.getElement().setAttribute("style", "padding:4px;");

    profiles = new ComboPicker();
    profiles.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(final ValueChangeEvent<String> event) {

            if (event.getValue() != null && !event.getValue().equals("")) {
              Scheduler.get()
                  .scheduleDeferred(
                      new Scheduler.ScheduledCommand() {
                        @Override
                        public void execute() {
                          Console.getEventBus()
                              .fireEvent(new ProfileSelectionEvent(event.getValue()));
                        }
                      });
            }
          }
        });

    Label profileLabel = new Label(Console.CONSTANTS.common_label_profile() + ":");
    profileLabel.setStyleName("header-label");
    layout.add(profileLabel);
    Widget hWidget = profiles.asWidget();
    hWidget.getElement().addClassName("table-picker");
    layout.add(hWidget);

    // the combox box use all available space
    hWidget.getElement().getParentElement().setAttribute("width", "100%");

    return layout;
  }
Ejemplo n.º 25
0
  @Override
  public Widget createWidget() {

    VerticalPanel vpanel = new VerticalPanel();
    vpanel.setStyleName("rhs-content-panel");

    vpanel.add(new ContentHeaderLabel(Console.CONSTANTS.subsys_ejb3_ejbServices()));
    vpanel.add(new ContentDescription(Console.CONSTANTS.subsys_ejb3_services_desc()));

    TabPanel bottomPanel = new TabPanel();
    bottomPanel.setStyleName("default-tabpanel");

    bottomPanel.add(timerServiceView.asWidget(), timerServiceView.getEntityDisplayName());
    bottomPanel.add(asyncServiceView.asWidget(), asyncServiceView.getEntityDisplayName());
    bottomPanel.add(remoteServiceView.asWidget(), remoteServiceView.getEntityDisplayName());
    bottomPanel.selectTab(0);

    vpanel.add(bottomPanel);

    return new ScrollPanel(vpanel);
  }
  private VerticalPanel createForm() {

    final VerticalPanel form = new VerticalPanel();
    form.setStyleName("formPanel");

    final HorizontalPanel titleLine = new HorizontalPanel();
    final HTML textNoteTitle = new HTML("Title: ");
    textNoteTitle.setWidth("50px");
    titleLine.add(textNoteTitle);
    titleLine.add(inputNoteTitle);

    final HorizontalPanel textLine = new HorizontalPanel();
    final HTML textNoteText = new HTML("Note: ");
    textNoteText.setWidth("50px");
    textLine.add(textNoteText);
    textLine.add(inputNoteText);

    form.add(titleLine);
    form.add(textLine);
    form.add(createButtons());

    return form;
  }
Ejemplo n.º 27
0
  private void initializeStatusPanel() {
    String comboWidth = "125px";
    statusPanel = new VerticalPanel();
    StyleInjector.inject(
        ".statusPanelStyle { "
            + "background: #E0ECF8;"
            + "border-radius: 5px 10px;"
            + "opacity: 0.8}");
    statusPanel.setStyleName("statusPanelStyle");

    statusPanel.setSpacing(5);
    statusPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    initializeLayerCombo(comboWidth);
    initializeEpsgCombo(comboWidth);
    initializeStatusGrid();

    statusPanel.add(new FieldLabel(layerCombo, UIMessages.INSTANCE.sbSelectLayerLabel()));
    statusPanel.add(new FieldLabel(epsgCombo, UIMessages.INSTANCE.sbEpsgLabel()));
    statusPanel.add(statusGrid);

    statusPanel.setVisible(false);
  }
Ejemplo n.º 28
0
  Widget asWidget() {

    breadcrumb = new HorizontalPanel();

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("fill-layout-width");
    panel.getElement().setAttribute("style", "padding:10px");

    // ----

    fileSystem = new DefaultCellTable<Entry>(30);

    fileSystemProvider = new ListDataProvider<Entry>();
    fileSystemProvider.addDataDisplay(fileSystem);

    TextColumn<Entry> entryCol =
        new TextColumn<Entry>() {
          @Override
          public String getValue(Entry entry) {
            return entry.getName();
          }
        };

    fileSystem.addColumn(entryCol);
    fileSystem.getElement().setAttribute("style", "margin-bottom:10px;");

    panel.add(breadcrumb);
    panel.add(fileSystem);

    // --
    Button visualize =
        new NavButton(
            "Visualize",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                presenter.onVisualize();
              }
            });
    panel.add(visualize);

    Button reify =
        new NavButton(
            "Reify",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                Entry dialog = fsSelection.getSelectedObject();
                presenter.onReify(dialog.getName());
              }
            });
    panel.add(reify);

    Button activate =
        new NavButton(
            "Activate",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                presenter.onActivate();
              }
            });
    panel.add(activate);

    Button reset =
        new NavButton(
            "Reset",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                presenter.onResetDialog();
              }
            });
    panel.add(reset);

    Button passivate =
        new NavButton(
            "Passivate",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                presenter.onPassivate();
              }
            });
    panel.add(passivate);

    CheckBox cacheDisabled = new CheckBox("Disable Cache");
    cacheDisabled.addValueChangeHandler(
        new ValueChangeHandler<Boolean>() {
          @Override
          public void onValueChange(ValueChangeEvent<Boolean> event) {
            presenter.setDisableCache(event.getValue());
          }
        });
    cacheDisabled.setValue(true);
    panel.add(cacheDisabled);

    // ----

    fsSelection = new SingleSelectionModel<Entry>();
    fileSystem.setSelectionModel(fsSelection);

    fsSelection.addSelectionChangeHandler(
        new SelectionChangeEvent.Handler() {
          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            Entry selection = fsSelection.getSelectedObject();
            if (selection != null) {
              if (Entry.Type.DIR == selection.getType()) {
                // directories
                Entry dir = history.peek();
                presenter.loadDir(
                    new Entry(dir.getName() + selection.getName(), Entry.Type.DIR), false);
              } else {
                // files
                presenter.loadFile(selection);
              }
            }
          }
        });

    return panel;
  }
Ejemplo n.º 29
0
  public Widget asWidget() {

    LayoutPanel layout = new LayoutPanel();

    VerticalPanel panel = new VerticalPanel();
    panel.setStyleName("rhs-content-panel");

    ScrollPanel scroll = new ScrollPanel(panel);
    layout.add(scroll);

    layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

    // ---

    HorizontalPanel horzPanel = new HorizontalPanel();
    horzPanel.getElement().setAttribute("style", "width:100%;");
    Image image = new Image(Icons.INSTANCE.messaging());
    horzPanel.add(image);
    horzPanel.add(new ContentHeaderLabel("JMS Subsystem Configuration"));
    image.getElement().getParentElement().setAttribute("width", "25");

    panel.add(horzPanel);

    // ----

    panel.add(new ContentGroupLabel("Connection Factories"));

    factoryTable = new DefaultCellTable<ConnectionFactory>(10);

    Column<ConnectionFactory, String> nameColumn =
        new Column<ConnectionFactory, String>(new TextCell()) {
          @Override
          public String getValue(ConnectionFactory object) {
            return object.getName();
          }
        };

    Column<ConnectionFactory, String> jndiColumn =
        new Column<ConnectionFactory, String>(new TextCell()) {
          @Override
          public String getValue(ConnectionFactory object) {
            return object.getJndiName();
          }
        };

    factoryTable.addColumn(nameColumn, "Name");
    factoryTable.addColumn(jndiColumn, "JNDI");

    StaticHelpPanel helpPanel = new StaticHelpPanel(MessagingDescription.getFactoryDescription());

    panel.add(helpPanel.asWidget());

    panel.add(factoryTable);

    // ----

    panel.add(new ContentGroupLabel("Subresources"));
    TabPanel bottomLayout = new TabPanel();
    bottomLayout.addStyleName("default-tabpanel");
    bottomLayout.getElement().setAttribute("style", "padding-top:20px;");

    queueList = new QueueList(presenter);
    bottomLayout.add(queueList.asWidget(), "Queues");

    topicList = new TopicList(presenter);
    bottomLayout.add(topicList.asWidget(), "Topics");

    bottomLayout.selectTab(0);

    panel.add(bottomLayout);

    return layout;
  }
Ejemplo n.º 30
0
  public Widget asWidget() {

    final TabPanel tabs = new TabPanel();
    tabs.setStyleName("default-tabpanel");

    // -------

    VerticalPanel layout = new VerticalPanel();
    layout.setStyleName("window-content");

    // Create a FormPanel and point it at a service.
    final FormPanel form = new FormPanel();
    String url = Console.getBootstrapContext().getProperty(BootstrapContext.DEPLOYMENT_API);
    form.setAction(url);

    form.setEncoding(FormPanel.ENCODING_MULTIPART);
    form.setMethod(FormPanel.METHOD_POST);

    // Create a panel to hold all of the form widgets.
    VerticalPanel panel = new VerticalPanel();
    panel.getElement().setAttribute("style", "width:100%");
    form.setWidget(panel);

    // Create a FileUpload widgets.
    final FileUpload upload = new FileUpload();
    upload.setName("uploadFormElement");
    panel.add(upload);

    final HTML errorMessages = new HTML("Please chose a file!");
    errorMessages.setStyleName("error-panel");
    errorMessages.setVisible(false);
    panel.add(errorMessages);

    // Add a 'submit' button.

    ClickHandler cancelHandler =
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            window.hide();
          }
        };

    ClickHandler submitHandler =
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {

            errorMessages.setVisible(false);

            // verify form
            String filename = upload.getFilename();

            if (tabs.getTabBar().getSelectedTab() == 1) {
              // unmanaged content
              if (unmanagedForm.validate().hasErrors()) {
                return;
              } else {
                wizard.onCreateUnmanaged(unmanagedForm.getUpdatedEntity());
              }
            } else if (filename != null && !filename.equals("")) {
              loading =
                  Feedback.loading(
                      Console.CONSTANTS.common_label_plaseWait(),
                      Console.CONSTANTS.common_label_requestProcessed(),
                      new Feedback.LoadingCallback() {
                        @Override
                        public void onCancel() {}
                      });
              form.submit();
            } else {
              errorMessages.setVisible(true);
            }
          }
        };

    DialogueOptions options =
        new DialogueOptions(
            Console.CONSTANTS.common_label_next(), submitHandler,
            Console.CONSTANTS.common_label_cancel(), cancelHandler);

    // Add an event handler to the form.
    form.addSubmitCompleteHandler(
        new FormPanel.SubmitCompleteHandler() {
          @Override
          public void onSubmitComplete(FormPanel.SubmitCompleteEvent event) {

            getLoading().hide();

            String html = event.getResults();

            // Step 1: upload content, retrieve hash value
            try {

              String json = html;

              try {
                if (!GWT.isScript()) // TODO: Formpanel weirdness
                json = html.substring(html.indexOf(">") + 1, html.lastIndexOf("<"));
              } catch (StringIndexOutOfBoundsException e) {
                // if I get this exception it means I shouldn't strip out the html
                // this issue still needs more research
                Log.debug("Failed to strip out HTML.  This should be preferred?");
              }

              JSONObject response = JSONParser.parseLenient(json).isObject();
              JSONObject result = response.get("result").isObject();
              String hash = result.get("BYTES_VALUE").isString().stringValue();
              // step2: assign name and group
              wizard.onUploadComplete(upload.getFilename(), hash);

            } catch (Exception e) {
              Log.error(Console.CONSTANTS.common_error_failedToDecode() + ": " + html, e);
            }

            // Option 2: Unmanaged content

          }
        });

    String stepText =
        "<h3>"
            + Console.CONSTANTS.common_label_step()
            + "1/2: "
            + Console.CONSTANTS.common_label_deploymentSelection()
            + "</h3>";
    layout.add(new HTML(stepText));
    HTML description = new HTML();
    description.setHTML(Console.CONSTANTS.common_label_chooseFile());
    description.getElement().setAttribute("style", "padding-bottom:15px;");
    layout.add(description);
    layout.add(form);
    tabs.add(layout, "Managed");

    // Unmanaged form only for new deployments
    if (!wizard.isUpdate()) {
      VerticalPanel unmanagedPanel = new VerticalPanel();
      unmanagedPanel.setStyleName("window-content");

      String unmanagedText =
          "<h3>" + Console.CONSTANTS.common_label_step() + "1/1: Specify Deployment</h3>";
      unmanagedPanel.add(new HTML(unmanagedText));

      unmanagedForm = new Form<DeploymentRecord>(DeploymentRecord.class);
      TextAreaItem path = new TextAreaItem("path", "Path");
      TextBoxItem relativeTo = new TextBoxItem("relativeTo", "Relative To", false);

      TextBoxItem name = new TextBoxItem("name", "Name");
      TextBoxItem runtimeName = new TextBoxItem("runtimeName", "Runtime Name");
      CheckBoxItem archive = new CheckBoxItem("archive", "Is Archive?");
      archive.setValue(true);
      unmanagedForm.setFields(path, relativeTo, archive, name, runtimeName);
      unmanagedPanel.add(unmanagedForm.asWidget());
      tabs.add(unmanagedPanel, "Unmanaged");
    }

    tabs.selectTab(0);
    return new WindowContentBuilder(tabs, options).build();
  }