Example #1
0
  public WeaponsView() {
    DecoratorPanel contentTableDecorator = new DecoratorPanel();
    initWidget(contentTableDecorator);
    contentTableDecorator.setWidth("100%");
    contentTableDecorator.setWidth("15em");

    contentTable = new FlexTable();
    contentTable.setWidth("100%");
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListContainer");
    contentTable.getCellFormatter().setWidth(0, 0, "100%");
    contentTable.getFlexCellFormatter().setVerticalAlignment(0, 0, DockPanel.ALIGN_TOP);

    HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setBorderWidth(0);
    hPanel.setSpacing(0);
    hPanel.setHorizontalAlignment(HorizontalPanel.ALIGN_LEFT);
    addButton = new Button("增加");
    hPanel.add(addButton);
    deleteButton = new Button("删除");
    hPanel.add(deleteButton);
    contentTable.getCellFormatter().addStyleName(0, 0, "contacts-ListMenu");
    contentTable.setWidget(0, 0, hPanel);

    contactsTable = new FlexTable();
    contactsTable.setCellSpacing(0);
    contactsTable.setCellPadding(0);
    contactsTable.setWidth("100%");
    contactsTable.addStyleName("contacts-ListContents");
    contactsTable.getColumnFormatter().setWidth(0, "15px");
    contentTable.setWidget(1, 0, contactsTable);

    contentTableDecorator.add(contentTable);
  }
Example #2
0
  public PanelResults() {
    super();
    this.setSpacing(10);

    DecoratorPanel panel = new DecoratorPanel();
    this.add(new HTML("<h4>Resultats par etudiant</h4>"));
    panel.add(new UserEnigmeTable().onInitialize());
    this.add(panel);

    DecoratorPanel panel2 = new DecoratorPanel();
    this.add(new HTML("<h4>Resultats par enigme</h4>"));
    panel2.add(new EnigmeUserTable().onInitialize());
    this.add(panel2);
  }
Example #3
0
  /** Instantiates a new change log panel. */
  private ChangeLogPanel() {

    MainPanel.setCommInfo(true);
    try {
      new RequestBuilder(RequestBuilder.GET, "CHANGELOG")
          .sendRequest(
              "",
              new RequestCallback() {
                @Override
                public void onError(Request res, Throwable throwable) {
                  MainPanel.setCommInfo(false);
                  Log.error(throwable.getMessage());
                }

                @Override
                public void onResponseReceived(Request request, Response response) {
                  MainPanel.setCommInfo(false);
                  String text = response.getText();
                  HTML w = new HTML("<p>" + text + "</p>");
                  d.setWidget(w);
                }
              });
    } catch (RequestException e) {
      MainPanel.setCommInfo(false);
      Log.error(e.getMessage());
    }

    d = new DecoratorPanel();
    d.setWidth("100%");

    initWidget(d);
  }
  public UploadAutorizar() {

    uploadTable = new FlexTable();

    notaInterinstitucional = createUploaderNotaInterinstitucional();

    uploadTable.setText(0, 0, "Nota Interinstitucional");
    uploadTable.setWidget(0, 1, notaInterinstitucional);

    VerticalPanel v = new VerticalPanel();
    DecoratorPanel dp = new DecoratorPanel();
    dp.add(uploadTable);
    v.add(new Label("Adjuntos"));
    v.add(dp);

    initWidget(v);

    addEliminarHander();
  }
Example #5
0
  //	public Rol(CriadorWidgets<T> criador, Parser<Ob, T> parser){
  public Rol(Parser<Ob, T> parser) {
    formularios = new ArrayList<T>();
    //		botaoMais = new BotaoMais(criador);
    botaoMais = new BotaoMais();
    painelWidgets = new VerticalPanel();
    this.parser = parser;

    DecoratorPanel painel = new DecoratorPanel();
    initWidget(painel);
    painel.setWidth("");

    VerticalPanel painelIntermediario = new VerticalPanel();
    painel.add(painelIntermediario);

    painelIntermediario.add(painelWidgets);
    painelIntermediario.add(botaoMais);

    botaoMais.onClick(null);
  }
  /**
   * Create a Dynamic tree. The code comes from the GWT show case :
   * http://gwt.google.com/samples/Showcase/Showcase.html#!CwTree
   *
   * @return
   */
  private Widget createDynamicTree() {
    // Create a new tree
    Tree dynamicTree = new Tree();

    // Add some default tree items
    for (int i = 0; i < 5; i++) {
      TreeItem item = dynamicTree.addItem("Item " + i);

      // Temporarily add an item so we can expand this node
      item.addItem("");
    }

    // Add a handler that automatically generates some children
    dynamicTree.addOpenHandler(
        new OpenHandler<TreeItem>() {
          public void onOpen(OpenEvent<TreeItem> event) {
            TreeItem item = event.getTarget();
            if (item.getChildCount() == 1) {
              // Close the item immediately
              item.setState(false, false);

              // Add a random number of children to the item
              String itemText = item.getText();
              int numChildren = Random.nextInt(5) + 2;
              for (int i = 0; i < numChildren; i++) {
                TreeItem child = item.addItem(itemText + "." + i);
                child.addItem("");
              }

              // Remove the temporary item when we finish loading
              item.getChild(0).remove();

              // Reopen the item
              item.setState(true, false);
            }
          }
        });

    // Return the tree (decorated)
    DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(dynamicTree);
    return decPanel;
  }
  public LeftTabPanel() {
    initWidget(main);
    main.add(left);
    left.add(leftTree);
    DecoratorPanel decorator = new DecoratorPanel();
    Style decoratorStyle = decorator.getElement().getStyle();
    decoratorStyle.setPropertyPx("marginLeft", 15);
    Style rightStyle = right.getElement().getStyle();
    rightStyle.setPropertyPx("margin", 5);
    decorator.add(right);

    main.add(decorator);
    leftTree.addSelectionHandler(
        new SelectionHandler<TreeItem>() {
          public void onSelection(SelectionEvent<TreeItem> event) {
            String name = event.getSelectedItem().getText();
            setWidget(right, cogs.get(name));
          }
        });
  }
  @Override
  public void render(final Context context, final ResultRowModel result, final SafeHtmlBuilder sb) {
    if (result == null) {
      return;
    }

    final StringBuilder stringBuilder = new StringBuilder();
    stringBuilder.append(
        "<b>Location</b> " + locationConstants.getString(result.getLocation()) + " <br/>");
    stringBuilder.append("<b>Server</b> " + result.getComputeCost() + " (RAM " + result.getRam());
    if (!ZERO_HERTZ.equals(result.getCpu())) {
      stringBuilder.append(" / CPU " + result.getCpu());
    }
    if (!ZERO_BYTE.equals(result.getStorage())) {
      stringBuilder.append(" / Storage " + result.getStorage());
    }
    stringBuilder.append(
        ") <br/> <b>Bandwidth</b> "
            + result.getBandwidthCost()
            + " (In "
            + result.getBandwidthInCost()
            + " / Out "
            + result.getBandwidthOutCost()
            + ")<br/>");
    final HTML config = new HTML(stringBuilder.toString());
    config.addStyleName("cloud-location-config");

    final String link = providerConstants.getString(result.getProviderName() + "_details_site");
    final Anchor anchor = new Anchor(staticConstants.location_details(), link);
    anchor.setTarget("_top");
    anchor.addStyleName("cloud-location-details");

    final FlowPanel panel = new FlowPanel();
    panel.add(config);
    panel.add(anchor);
    panel.addStyleName("cloud-location");
    final DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(panel);
    sb.appendHtmlConstant(decPanel.toString());
  }
  /**
   * Create a Decorated Form The code comes from the GWT show case :
   * http://gwt.google.com/samples/Showcase/Showcase.html#!CwDecoratorPanel
   *
   * @return
   */
  private DecoratorPanel createDecoratedForm() {
    // 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, "Enter Search Criteria");
    cellFormatter.setColSpan(0, 0, 2);
    cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);

    // Add some standard form options
    layout.setHTML(1, 0, "Name");
    layout.setWidget(1, 1, new TextBox());
    layout.setHTML(2, 0, "Description");
    layout.setWidget(2, 1, new TextBox());

    // Wrap the content in a DecoratorPanel
    DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(layout);
    return decPanel;
  }
Example #10
0
  /** Build a view */
  public void build() {
    // Construct a dock panel
    DockPanel dock = new DockPanel();
    dock.setStyleName("cw-DockPanel");
    dock.add(buildHeader(), DockPanel.NORTH);
    dock.add(buildDescription(), DockPanel.NORTH);
    dock.add(buildContent(), DockPanel.CENTER);
    dock.add(buildStepBar(), DockPanel.SOUTH);
    dock.add(buildToolbar(), DockPanel.SOUTH);

    // Configure Main panel
    setSpacing(5);
    setSize("100%", "500px");
    setHorizontalAlignment(HorizontalPanel.ALIGN_CENTER);
    setVerticalAlignment(HorizontalPanel.ALIGN_MIDDLE);

    DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(dock);

    // Add constructed view
    add(decPanel);
  }
Example #11
0
  /**
   * Default constructor.
   *
   * @param aDataSource
   * @param aStep
   * @param mustBeVisible
   */
  public CaseRecapViewerWidget(
      StepItemDataSource aDataSource,
      CaseItem aCase,
      CaseDataSource aCaseDataSource,
      ProcessDataSource aProcessDataSource) {
    super();
    myStepDataSource = aDataSource;
    myCaseDataSource = aCaseDataSource;
    myProcessDataSource = aProcessDataSource;
    myCase = aCase;
    formId = myCase.getProcessUUID().getValue() + "$recap";
    myInnerPanel.add(myFirstRowPanel);
    myInnerPanel.add(mySecondRowPanel);
    myInnerPanel.add(myThirdRowPanel);
    myOuterPanel.add(myInnerPanel);

    myFirstRowPanel.setStylePrimaryName("bos_first_row");
    mySecondRowPanel.setStylePrimaryName("bos_second_row");
    myThirdRowPanel.setStylePrimaryName("bos_third_row");
    myInnerPanel.setStylePrimaryName("bos_case_recap_viewer_inner");
    myOuterPanel.setStylePrimaryName("bos_case_recap_viewer");
    myOuterPanel.addStyleName(CSSClassManager.ROUNDED_PANEL);
    this.initWidget(myOuterPanel);

    myProcessDataSource.getItem(
        myCase.getProcessUUID(),
        new AsyncHandler<BonitaProcess>() {
          public void handleFailure(Throwable aT) {
            // Do nothing.
            GWT.log("Unable to get the process definition:", aT);
          }

          public void handleSuccess(BonitaProcess aResult) {
            myProcess = aResult;
            initContent();
            update();
          }
        });
  }
  public Widget asWidget() {
    Widget layout = UI_BINDER.createAndBindUi(this);

    // Create the MapPresenter and add an InitializationHandler:
    mapPresenter = GeomajasImpl.getInstance().createMapPresenter();
    mapPresenter.setSize(480, 480);
    mapPresenter.getEventBus().addMapInitializationHandler(new MyMapInitializationHandler());

    // Define the whole layout:
    DecoratorPanel mapDecorator = new DecoratorPanel();
    mapDecorator.add(mapPresenter.asWidget());
    mapPanel.add(mapDecorator);

    // Initialize the map, and return the layout:
    GeomajasServerExtension.getInstance().initializeMap(mapPresenter, "gwt-app", "mapOsm");
    label.setVisible(false);
    for (int option : options) {
      countBox.addItem(option + "");
    }
    countBox.setSelectedIndex(2);
    return layout;
  }
  /** Default constructor */
  public DeleteConfiguration() {
    super();

    initService();

    initWidget(mainPanel);

    mainPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    mainPanel.setSpacing(10);

    DecoratorPanel dp = new DecoratorPanel();
    mainPanel.add(dp);
    mainPanel.setCellHorizontalAlignment(dp, HasHorizontalAlignment.ALIGN_CENTER);

    mainPanel.setWidth(DOCK_PANEL_WIDTH);

    upperPanel.setWidth(PERCENT_100);
    upperPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    upperPanel.setSpacing(10);

    // Sub-Title
    Label subTitleLabel = new Label(SUB_TITLE);
    subTitleLabel.addStyleDependentName(SUB_TITLE_LABEL_STYLE);
    upperPanel.add(subTitleLabel);
    upperPanel.setCellHorizontalAlignment(subTitleLabel, HasHorizontalAlignment.ALIGN_CENTER);

    wbConfigTextBox.addChangeHandler(this);
    LabeledWidget workbookIdBox = new LabeledWidget(wbConfigTextBox);
    workbookIdBox.setLabelText(CONFIG_ID_COLON);
    workbookIdBox.setPanelWidth(RESULTS_DATA_WIDTH);
    upperPanel.add(workbookIdBox);

    submitButton.addClickHandler(this);
    submitButton.setEnabled(false);
    upperPanel.add(submitButton);

    dp.add(upperPanel);
  }
Example #14
0
  /** Initialize this example. */
  @ShowcaseSource
  @Override
  public Widget onInitialize() {
    // 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, constants.cwDecoratorPanelFormTitle());
    cellFormatter.setColSpan(0, 0, 2);
    cellFormatter.setHorizontalAlignment(0, 0, HasHorizontalAlignment.ALIGN_CENTER);

    // Add some standard form options
    layout.setHTML(1, 0, constants.cwDecoratorPanelFormName());
    layout.setWidget(1, 1, new TextBox());
    layout.setHTML(2, 0, constants.cwDecoratorPanelFormDescription());
    layout.setWidget(2, 1, new TextBox());

    // Wrap the content in a DecoratorPanel
    DecoratorPanel decPanel = new DecoratorPanel();
    decPanel.setWidget(layout);
    return decPanel;
  }
Example #15
0
  public static VerticalPanel init() {

    // layout.setCellSpacing(8);
    // layout.setWidth("100%");
    panel.setWidth("35%");
    layoutFormat = layout.getFlexCellFormatter();
    layout.setText(0, 0, "Username: "******"Password: "******"");
    layout.setWidget(2, 1, signIn);
    layout.setWidget(2, 2, lSignInStatus);

    layoutFormat = layoutSignup.getFlexCellFormatter();
    layoutSignup.setText(0, 0, "Confirm password: "******"E-mail: ");
    layoutSignup.setWidget(1, 1, inputEmail);
    layoutFormat.setColSpan(1, 1, 2);
    // layoutSignup.setText(2, 0, ""); //passwords do not match
    lSignUpStatus.setText("");
    layoutSignup.setWidget(2, 1, signUp);
    layoutSignup.setWidget(2, 2, lSignUpStatus);

    signUpDisclosure.setAnimationEnabled(true);
    // signUpDisclosure.ensureDebugId("cwDisclosurePanel");
    signUpDisclosure.setContent(layoutSignup);

    // Wrap the contents in a DecoratorPanel
    signUpPanel.setWidget(layout);

    panel.add(layout);
    panel.add(signUpDisclosure);

    initHandlers();

    return panel;
  }
Example #16
0
 /**
  * Create a DecoratorPanel that contains one widget
  *
  * @param widget
  * @return
  */
 public static DecoratorPanel decoratorPanel(Widget widget) {
   DecoratorPanel panel = GWT.create(DecoratorPanel.class);
   panel.setWidget(widget);
   return panel;
 }
Example #17
0
 public MenuChoicesPanel() {
   super();
   myContainer.add(myOuterPanel);
   myContainer.removeStyleName(myContainer.getStylePrimaryName());
   this.initWidget(myContainer);
 }