@Override
  protected EnhancedVLayout buildContentPane() {
    EnhancedVLayout contentPane = new EnhancedVLayout();
    contentPane.setWidth100();
    contentPane.setHeight100();
    contentPane.setOverflow(Overflow.AUTO);

    EnhancedDynamicForm form = buildForm();
    setForm(form);

    EnhancedVLayout topPane = new EnhancedVLayout();
    topPane.setWidth100();
    topPane.setHeight(80);
    topPane.addMember(form);

    contentPane.addMember(topPane);

    TabSet tabSet = new TabSet();
    tabSet.setWidth100();
    tabSet.setHeight100();

    this.bundlesTab = buildBundlesTab(tabSet);
    tabSet.addTab(bundlesTab);

    contentPane.addMember(tabSet);

    return contentPane;
  }
Example #2
0
  protected Canvas defaultView() {
    EnhancedVLayout vLayout = new EnhancedVLayout();
    vLayout.setWidth100();

    // TODO: Help icon.
    TitleBar titleBar = new TitleBar(MSG.view_testTop_title());
    vLayout.addMember(titleBar);

    Label label = new Label(MSG.view_testTop_description());
    label.setPadding(10);
    vLayout.addMember(label);

    return vLayout;
  }
  private Canvas getActionLayout() {
    EnhancedVLayout actionLayout = new EnhancedVLayout(10);
    IButton deleteButton = new EnhancedIButton(MSG.common_button_delete(), ButtonColor.RED);
    // deleteButton.setIcon("subsystems/bundle/BundleVersionAction_Delete_16.png");
    deleteButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent clickEvent) {
            SC.ask(
                MSG.view_bundle_version_deleteConfirm(),
                new BooleanCallback() {
                  public void execute(Boolean aBoolean) {
                    if (aBoolean) {
                      bundleManager.deleteBundleVersion(
                          version.getId(),
                          false,
                          new AsyncCallback<Void>() {
                            public void onFailure(Throwable caught) {
                              CoreGUI.getErrorHandler()
                                  .handleError(
                                      MSG.view_bundle_version_deleteFailure(version.getVersion()),
                                      caught);
                            }

                            public void onSuccess(Void result) {
                              CoreGUI.getMessageCenter()
                                  .notify(
                                      new Message(
                                          MSG.view_bundle_version_deleteSuccessful(
                                              version.getVersion()),
                                          Message.Severity.Info));
                              // Bundle version is deleted, go back to main bundle view
                              CoreGUI.goToView(
                                  LinkManager.getBundleVersionLink(version.getBundle().getId(), 0),
                                  true);
                            }
                          });
                    }
                  }
                });
          }
        });
    actionLayout.addMember(deleteButton);

    if (!canDelete) {
      deleteButton.setDisabled(true);
    }

    return actionLayout;
  }
Example #4
0
  @Override
  protected void onInit() {
    super.onInit();
    Layout layout = new VLayout();
    layout.setPadding(5);
    layout.setMembersMargin(5);
    layout.addMember(getConnectionForm());
    layout.setDefaultLayoutAlign(Alignment.CENTER);
    layout.setLayoutAlign(Alignment.CENTER);

    if (this.showInstallButton) {
      agentConfigXmlUploadForm = createAgentConfigXmlUploadForm();
      layout.addMember(agentConfigXmlUploadForm);
      /* For now, don't allow users to upload and ship their own env script to a remote machine; that might have security implications.
       * If we want to allow this, just uncomment these lines and you are good to go because everything else that is needed
       * is already in place and working as of April 2014.
      rhqAgentEnvUploadForm = createAgentEnvUploadForm();
      layout.addMember(rhqAgentEnvUploadForm);
      */
    }

    HTMLFlow header = new HTMLFlow("");
    header.setStyleName("headerItem");
    header.setExtraSpace(5);
    layout.addMember(header);
    layout.addMember(getButtons());

    addMember(layout);
  }
  @Override
  protected Canvas buildResultsSection(GroupOperationHistory operationHistory) {
    EnhancedVLayout resultsSection = new EnhancedVLayout();

    Label title = new Label("<h4>" + MSG.view_operationHistoryDetails_results() + "</h4>");
    title.setHeight(27);
    resultsSection.addMember(title);

    GroupMemberResourceOperationHistoryListView memberHistoryListView =
        new GroupMemberResourceOperationHistoryListView(
            this.groupComposite, getOperationHistory().getId());
    memberHistoryListView.setOverflow(Overflow.VISIBLE);
    memberHistoryListView.setHeight(200);
    resultsSection.addMember(memberHistoryListView);

    return resultsSection;
  }
  @Override
  protected void onDraw() {
    super.onDraw();

    // wait until we have all of the sections before we show them. We don't use InitializableView
    // because,
    // it seems they are not supported (in the applicable renderView()) at this level.
    new Timer() {
      final long startTime = System.currentTimeMillis();

      public void run() {
        if (isInitialized()) {
          if (null != detailsSection) {
            sectionStack.addSection(detailsSection);
          }
          if (null != helpSection) {
            sectionStack.addSection(helpSection);
          }
          if (null != controlsSection) {
            sectionStack.addSection(controlsSection);
          }
          if (null != pluginConfigSection) {
            sectionStack.addSection(pluginConfigSection);
          }
          if (null != scheduledJobsSection) {
            sectionStack.addSection(scheduledJobsSection);
          }

          addMember(sectionStack);
          markForRedraw();

        } else {
          // don't wait forever, give up after 20s and show what we have
          long elapsedMillis = System.currentTimeMillis() - startTime;
          if (elapsedMillis > 20000) {
            initSectionCount = 5;
          }
          schedule(100); // Reschedule the timer.
        }
      }
    }.run(); // fire the timer immediately
  }
  @Override
  protected void onInit() {
    super.onInit();

    pluginManager.getServerPlugin(
        this.pluginId,
        true,
        new AsyncCallback<ServerPlugin>() {
          public void onSuccess(ServerPlugin plugin) {
            prepareDetailsSection(sectionStack, plugin);
            prepareHelpSection(sectionStack, plugin);
            prepareControlsSection(sectionStack, plugin);
            preparePluginConfigurationSection(sectionStack, plugin);
            prepareScheduledJobsSection(sectionStack, plugin);
          }

          public void onFailure(Throwable caught) {
            CoreGUI.getErrorHandler().handleError(MSG.view_admin_plugins_loadFailure(), caught);
          }
        });
  }
  @Override
  protected void onDraw() {
    super.onDraw();

    final TreeGrid treeGrid = new CustomResourceTypeTreeGrid();

    treeGrid.setHeight100();

    treeGrid.setTitle(MSG.view_type_resourceTypes());
    treeGrid.setAnimateFolders(false);
    treeGrid.setResizeFieldsInRealTime(true);

    final TreeGridField name, plugin, category;
    name = new TreeGridField("name");
    plugin = new TreeGridField("plugin");
    category = new TreeGridField("category");

    treeGrid.setFields(name, plugin, category);

    addMember(treeGrid);

    ResourceTypeCriteria criteria = new ResourceTypeCriteria();
    criteria.addFilterIgnored((showIgnoredResourceTypes ? (Boolean) null : Boolean.FALSE));
    criteria.fetchParentResourceTypes(true);
    criteria.setPageControl(PageControl.getUnlimitedInstance());

    resourceTypeService.findResourceTypesByCriteria(
        criteria,
        new AsyncCallback<PageList<ResourceType>>() {
          public void onFailure(Throwable caught) {
            CoreGUI.getErrorHandler().handleError(MSG.widget_typeTree_loadFail(), caught);
          }

          public void onSuccess(PageList<ResourceType> result) {

            treeGrid.getTree().linkNodes(ResourceTypePluginTreeDataSource.buildNodes(result));
          }
        });
  }