Ejemplo n.º 1
0
  public LaunchFormLayout(String title, String icon, final String description) {

    super("600", "*");
    addTitle(title, icon);

    Label docLabel =
        WidgetUtil.getLabel(
            "Documentation and Terms of Use", CoreConstants.ICON_INFORMATION, 30, Cursor.HAND);
    docLabel.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            new DocumentationLayout(event.getX(), event.getY(), description).show();
          }
        });
    this.addMember(docLabel);

    simulationNameItem = FieldUtil.getTextItem(400, "[0-9A-Za-z-_ ]");
    simulationNameItem.setValidators(ValidatorUtil.getStringValidator());
    addField("Simulation Name", simulationNameItem);

    sourcesLayout = new VLayout(5);
    sourcesLayout.setAutoHeight();
    this.addMember(sourcesLayout);
  }
Ejemplo n.º 2
0
  public PermissionsEditor(RoleEditView roleEditView, boolean isReadOnly) {
    super(roleEditView.extendLocatorId("Permissions"));

    this.roleEditView = roleEditView;
    this.isReadOnly = isReadOnly;
    // Default permission set
    this.selectedPermissions = EnumSet.of(Permission.VIEW_RESOURCE);

    setWidth("95%");
    setHeight100();

    VLayout spacer = createVerticalSpacer(13);
    addMember(spacer);

    Label globalPermissionsHeader =
        new Label("<h4>" + MSG.view_adminRoles_permissions_globalPermissions() + "</h4>");
    globalPermissionsHeader.setHeight(17);
    addMember(globalPermissionsHeader);

    this.globalPermissionsGrid = createGlobalPermissionsGrid();
    addMember(this.globalPermissionsGrid);

    spacer = createVerticalSpacer(13);
    addMember(spacer);

    Label resourcePermissionsHeader =
        new Label("<h4>" + MSG.view_adminRoles_permissions_resourcePermissions() + "</h4>");
    resourcePermissionsHeader.setHeight(17);
    addMember(resourcePermissionsHeader);

    this.resourcePermissionsGrid = createResourcePermissionsGrid();
    addMember(this.resourcePermissionsGrid);
  }
Ejemplo n.º 3
0
 public void setExportButtonActiv(boolean activ) {
   if (activ) {
     exportButton.setDisabled(false);
     exportButton.setStyleName("n52_sensorweb_client_legendbutton");
   } else {
     exportButton.setDisabled(true);
     exportButton.setStyleName("n52_sensorweb_client_legendbuttonDisabled");
   }
 }
Ejemplo n.º 4
0
 private void selectPrimaryMenu(String selectedModule) {
   // Set selected primary menu option.
   for (String moduleKey : moduleLabelMap.keySet()) {
     Label primaryMenuLabel = moduleLabelMap.get(moduleKey);
     if (moduleKey.equals(selectedModule)) {
       primaryMenuLabel.setBaseStyle("primaryMenuText-selected");
     } else {
       primaryMenuLabel.setBaseStyle("primaryMenuText");
     }
   }
 }
Ejemplo n.º 5
0
 private Label createAddTimeSeriesLabelButton() {
   Label addTS = new Label(i18n.picker());
   addTS.setStyleName("n52_sensorweb_client_legendbuttonPrimary");
   addTS.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           StationSelector.getInst().show();
         }
       });
   return addTS;
 }
  /**
   * Build and return this view's graphical components
   *
   * @return
   */
  public Layout build() {
    this.root = new VLayout();
    this.root.setWidth100();
    this.root.setHeight100();

    statsDetail = new DetailViewer();
    statsDetail.setCanSelectText(true);
    DetailViewerField sd1 = new DetailViewerField("JobSubmittingPeriod", "Job Submitting Period");
    DetailViewerField sd2 =
        new DetailViewerField("FormattedJobSubmittingPeriod", "Formatted Job Submitting Period");
    DetailViewerField sd3 = new DetailViewerField("MeanJobPendingTime", "Mean Job Pending Time");
    DetailViewerField sd4 = new DetailViewerField("ConnectedUsersCount", "Connected Users Count");
    DetailViewerField sd5 = new DetailViewerField("FinishedTasksCount", "Finished Tasks Count");
    DetailViewerField sd6 = new DetailViewerField("RunningJobsCount", "Running Jobs Count");
    DetailViewerField sd7 = new DetailViewerField("RunningTasksCount", "Running Tasks Count");
    DetailViewerField sd8 =
        new DetailViewerField("FormattedMeanJobPendingTime", "Formatted Mean Job Pending Time");
    DetailViewerField sd9 =
        new DetailViewerField("MeanJobExecutionTime", "Mean Job Execution Time");
    DetailViewerField sd10 = new DetailViewerField("PendingTasksCount", "Pending Tasks Count");
    DetailViewerField sd11 = new DetailViewerField("FinishedJobsCount", "Finished Jobs Count");
    DetailViewerField sd12 = new DetailViewerField("TotalTasksCount", "Total Tasks Count");
    DetailViewerField sd13 =
        new DetailViewerField("FormattedMeanJobExecutionTime", "Formatted Mean Job Execution Time");
    DetailViewerField sd14 = new DetailViewerField("TotalJobsCount", "Total Jobs Count");
    DetailViewerField sd15 = new DetailViewerField("PendingJobsCount", "Pending Jobs Count");
    statsDetail.setFields(
        sd1, sd2, sd3, sd4, sd5, sd6, sd7, sd8, sd9, sd10, sd11, sd12, sd13, sd14, sd15);

    accountDetail = new DetailViewer();
    accountDetail.setCanSelectText(true);
    DetailViewerField ad1 = new DetailViewerField("TotalTaskCount", "Total Task Count");
    DetailViewerField ad2 = new DetailViewerField("TotalJobDuration", "Total Job Duration");
    DetailViewerField ad3 = new DetailViewerField("TotalJobCount", "Total Job Count");
    DetailViewerField ad4 = new DetailViewerField("TotalTaskDuration", "Total Task Duration");
    accountDetail.setFields(ad1, ad2, ad3, ad4);

    l1 = new Label("<h3>Scheduler statistics</h3>");
    l1.setHeight(25);
    l1.hide();

    l2 = new Label("<h3>My account</h3>");
    l2.setHeight(25);
    l2.hide();

    this.root.addMember(l1);
    this.root.addMember(statsDetail);
    this.root.addMember(l2);
    this.root.addMember(accountDetail);

    return this.root;
  }
Ejemplo n.º 7
0
 private Label createSESTabLabelButton() {
   Label sesTabLabelButton = new Label(i18n.editProfile());
   sesTabLabelButton.setStyleName("n52_sensorweb_client_legendbutton");
   sesTabLabelButton.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           Legend.this.showProfileWindow();
         }
       });
   sesTabLabelButton.setVisible(true);
   return sesTabLabelButton;
 }
Ejemplo n.º 8
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;
  }
Ejemplo n.º 9
0
  @Override
  protected LocatableVLayout defaultView() {
    LocatableVLayout vLayout = new LocatableVLayout(this.extendLocatorId("Default"));
    vLayout.setWidth100();

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

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

    return vLayout;
  }
  @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;
  }
Ejemplo n.º 11
0
 public Bottom() {
   setWidth100();
   setHeight(20);
   Label about = new Label("Information Center 08. Copyright 2010 - 2011. ");
   about.setWidth100();
   about.setHeight100();
   about.setAlign(Alignment.RIGHT);
   about.setStyleName("abouttext");
   setMembers(about);
   addShowContextMenuHandler(
       new ShowContextMenuHandler() {
         @Override
         public void onShowContextMenu(ShowContextMenuEvent event) {
           event.cancel();
         }
       });
 }
Ejemplo n.º 12
0
 private Label createExportLabelButton() {
   Label export = new Label(i18n.export());
   export.setStyleName("n52_sensorweb_client_legendbuttonDisabled");
   export.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           if (exportMenu.isVisible()) {
             exportMenu.hide();
           } else {
             exportMenu.setLeft(exportButton.getAbsoluteLeft() - 2);
             exportMenu.setWidth(exportButton.getWidth());
             exportMenu.show();
           }
         }
       });
   return export;
 }
 /*
  * (non-Javadoc)
  * @see org.ow2.proactive_grid_cloud_portal.client.Listeners.StatisticsListener#accountStatsUpdated(org.ow2.proactive_grid_cloud_portal.shared.AccountStatistics)
  */
 public void accountStatsUpdated(HashMap<String, String> stats) {
   DetailViewerRecord r = new DetailViewerRecord();
   r.setAttribute("TotalTaskCount", stats.get("TotalTaskCount"));
   r.setAttribute("TotalJobDuration", stats.get("TotalJobDuration"));
   r.setAttribute("TotalJobCount", stats.get("TotalJobCount"));
   r.setAttribute("TotalTaskDuration", stats.get("TotalTaskDuration"));
   this.accountDetail.setData(new DetailViewerRecord[] {r});
   l2.show();
 }
Ejemplo n.º 14
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);
 }
Ejemplo n.º 15
0
  /**
   * Update the rows retrieved label based on the search results.
   *
   * @param dc
   */
  private void updateRowsRetrieved(DataClass[] dc) {
    if (dc.length >= 1) {

      String numEntries = dc[0].getAttribute("numEntries");
      String complete = dc[0].getAttribute("complete");

      if (complete != null && !complete.equals("COMPLETE")) {
        i_rowsRetrievedLabel.setContents(ROWS_RETRIEVED_TITLE + "<b> " + numEntries + "</b>+");
      } else {
        i_rowsRetrievedLabel.setContents(ROWS_RETRIEVED_TITLE + " <b>" + numEntries + "</b>");
      }

      String searchText = i_searchTextItem.getValueAsString();
      if (searchText == null || searchText.length() == 0) {
        i_rowsRetrievedLabel.setContents("");
      }
    } else {
      i_rowsRetrievedLabel.setContents(ROWS_RETRIEVED_TITLE + " <b>0</b>");
    }
  }
  public UpgradeLevelLayout(int x, int y) {

    this.setWidth(500);
    this.setHeight(300);
    this.setMembersMargin(5);
    this.setPadding(5);
    this.setBackgroundColor("#FFFFFF");
    this.setBorder("1px solid #CCCCCC");
    this.setOpacity(85);
    this.moveTo(x, y + 20);

    Label titleLabel = new Label("<b>User Levels:</b>");
    titleLabel.setIcon(CoreConstants.ICON_USER_INFO);
    titleLabel.setHeight(30);
    this.addMember(titleLabel);

    HTMLPane pane = new HTMLPane();
    pane.setWidth100();
    pane.setHeight100();
    pane.setOverflow(Overflow.AUTO);
    pane.setContentsURL("./documentation/user/user_levels.html");
    pane.setContentsType(ContentsType.PAGE);
    this.addMember(pane);

    Label closeLabel = new Label("Close");
    closeLabel.setIcon(CoreConstants.ICON_CLOSE);
    closeLabel.setHeight(25);
    closeLabel.setWidth100();
    closeLabel.setAlign(Alignment.RIGHT);
    closeLabel.setCursor(Cursor.HAND);
    closeLabel.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            destroy();
          }
        });

    this.addMember(closeLabel);
  }
Ejemplo n.º 17
0
  private Label buildSecondaryMenuOption(final String title, boolean selected) {
    Label tmp = new Label(title);
    tmp.setTitle(title);
    tmp.setWrap(false);
    tmp.setValign(VerticalAlignment.BOTTOM);
    tmp.setAlign(Alignment.CENTER);
    tmp.setPadding(10);
    tmp.setShowRollOver(true);
    tmp.setCursor(Cursor.POINTER);

    String style;

    if (selected) {
      style = "secondaryMenuText-selected";
      selectedSecondaryMenuOption = tmp;
    } else {
      style = "secondaryMenuText";
    }
    tmp.setBaseStyle(style);

    tmp.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            Object o = event.getSource();
            if (o instanceof Label) {
              Label lbl = (Label) o;
              if (!lbl.getTitle().equals(selectedSecondaryMenuOption.getTitle())) {
                selectedSecondaryMenuOption.setBaseStyle("secondaryMenuText");
                lbl.setBaseStyle("secondaryMenuText-selected");
                selectedSecondaryMenuOption = lbl;
                BLCMain.setCurrentPageKey(lbl.getTitle());
                buildHistoryNewItem(
                    lbl.getTitle(), BLCLaunch.getSelectedModule(History.getToken()), null);
              }
            }
          }
        });

    return tmp;
  }
Ejemplo n.º 18
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;
  }
Ejemplo n.º 19
0
  private Label buildPrimaryMenuOption(final Module module, boolean selected) {
    Label tmp = new Label(module.getModuleTitle());
    tmp.setValign(VerticalAlignment.CENTER);
    tmp.setHeight(30);
    tmp.setAlign(Alignment.CENTER);
    tmp.setWrap(false);
    tmp.setPadding(0);
    tmp.setShowRollOver(true);
    tmp.setCursor(Cursor.POINTER);

    final String style;
    if (selected) {
      style = "primaryMenuText-selected";
    } else {
      style = "primaryMenuText";
    }

    tmp.setBaseStyle(style);

    tmp.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(final ClickEvent event) {
            Object o = event.getSource();
            if (o instanceof Label) {
              final Label lbl = (Label) o;
              if (!"primaryMenuText-selected".equals(lbl.getBaseStyle())) {
                selectPrimaryMenu(module.getModuleKey());
                lbl.setBaseStyle("primaryMenuText-selected");
                BLCMain.setCurrentModuleKey(module.getModuleKey());
                buildSecondaryMenu(null, module.getModuleKey());
                AppController.getInstance()
                    .go(canvas, module.getPages(), null, module.getModuleKey(), false);
              }
            }
          }
        });

    return tmp;
  }
Ejemplo n.º 20
0
  public Canvas getViewPanel() {
    Label label =
        new Label(
            "Staging: <span style=\"color: green; font-weight: bold;\">Normal</span><br/>"
                + "Production: <span style=\"color: green; font-weight: bold;\">Normal</span><br/>"
                + "Development: <span style=\"color: green; font-weight: bold;\">Normal</span>");
    label.setHeight100();
    label.setPadding(5);
    label.setValign(VerticalAlignment.TOP);

    Window window = new Window();
    window.setTitle("Minimizing a window");
    window.setWidth(300);
    window.setHeight(85);
    window.setCanDragResize(true);
    window.addItem(label);

    Canvas canvasMain = new Canvas();
    canvasMain.addChild(window);

    return canvasMain;
  }
Ejemplo n.º 21
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());
  }
Ejemplo n.º 22
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);
  }
Ejemplo n.º 23
0
 public SavePanel(
     String saveTitle, ClickHandler saveClicked, String cancelTitle, ClickHandler cancelClicked) {
   if (saveTitle == null || saveTitle.trim().length() == 0)
     saveTitle = "OK"; // ClientSession.getInstance().getCaption("save");
   if (cancelTitle == null || cancelTitle.trim().length() == 0)
     cancelTitle = "Close"; // ClientSession.getInstance().getCaption("cancel");
   hl = new HLayout();
   hl.setAlign(Alignment.RIGHT);
   saveBtn = new IButton(saveTitle);
   saveBtn.addClickHandler(saveClicked);
   cancelBtn = new IButton(cancelTitle);
   cancelBtn.addClickHandler(cancelClicked);
   hl.addMember(saveBtn);
   hl.addMember(cancelBtn);
   hl.setWidth100();
   hl.setMembersMargin(10);
   hl.setHeight("30");
   Label l = new Label();
   l.setTitle("");
   l.setContents("");
   l.setWidth(0);
   hl.addMember(l);
   addMember(hl);
 }
Ejemplo n.º 24
0
  private void buildFooter() {
    bottomBar = new ToolStrip();
    bottomBar.setBackgroundImage(GWT.getModuleBaseURL() + "admin/images/header_bg.png");
    bottomBar.setHeight(30);
    bottomBar.setWidth100();
    status = new Label();
    status.setWrap(false);
    bottomBar.addSpacer(6);

    bottomBar.addMember(status);
    bottomBar.addFill();
    bottomBar.addMember(BLCMain.NON_MODAL_PROGRESS);
    bottomBar.addSpacer(5);

    addMember(bottomBar);
  }
Ejemplo n.º 25
0
  @Override
  public Canvas getView() {
    HLayout v = new HLayout();
    v.setAutoHeight();
    v.setAutoWidth();
    v.setAlign(Alignment.CENTER);

    hintlabel = new Label();
    hintlabel.setHeight(30);

    Img img = new Img("loading.gif");
    img.setSize("48px", "48px");

    v.addMember(img);
    v.addMember(hintlabel);
    return v;
  }
Ejemplo n.º 26
0
 private Label createPDFLabel() {
   Label toPDF = new Label(i18n.toPDF());
   toPDF.setWrap(false);
   toPDF.setAutoFit(true);
   toPDF.setPadding(3);
   toPDF.setWidth100();
   toPDF.setStyleName("n52_sensorweb_client_exportEntry");
   toPDF.addClickHandler(
       new ClickHandler() {
         @Override
         public void onClick(ClickEvent event) {
           controller.exportTo(ExportType.PDF_ALL_IN_ONE);
           exportMenu.hide();
         }
       });
   return toPDF;
 }
  /*
   * (non-Javadoc)
   * @see org.ow2.proactive_grid_cloud_portal.client.Listeners.StatisticsListener#schedulerStatsUpdated(org.ow2.proactive_grid_cloud_portal.shared.SchedulerStatistics)
   */
  public void schedulerStatsUpdated(HashMap<String, String> stats) {
    DetailViewerRecord r = new DetailViewerRecord();
    r.setAttribute("JobSubmittingPeriod", stats.get("JobSubmittingPeriod"));
    r.setAttribute("FormattedJobSubmittingPeriod", stats.get("FormattedJobSubmittingPeriod"));
    r.setAttribute("MeanJobPendingTime", stats.get("MeanJobPendingTime"));
    r.setAttribute("ConnectedUsersCount", stats.get("ConnectedUsersCount"));
    r.setAttribute("FinishedTasksCount", stats.get("FinishedTasksCount"));
    r.setAttribute("RunningJobsCount", stats.get("RunningJobsCount"));
    r.setAttribute("RunningTasksCount", stats.get("RunningTasksCount"));
    r.setAttribute("FormattedMeanJobPendingTime", stats.get("FormattedMeanJobPendingTime"));
    r.setAttribute("MeanJobExecutionTime", stats.get("MeanJobExecutionTime"));
    r.setAttribute("PendingTasksCount", stats.get("PendingTasksCount"));
    r.setAttribute("FinishedJobsCount", stats.get("FinishedJobsCount"));
    r.setAttribute("TotalTasksCount", stats.get("TotalTasksCount"));
    r.setAttribute("FormattedMeanJobExecutionTime", stats.get("FormattedMeanJobExecutionTime"));
    r.setAttribute("TotalJobsCount", stats.get("TotalJobsCount"));
    r.setAttribute("PendingJobsCount", stats.get("PendingJobsCount"));

    this.statsDetail.setData(new DetailViewerRecord[] {r});
    l1.show();
  }
Ejemplo n.º 28
0
 public void clearStatus() {
   status.setContents("");
 }
  public UserDetailTabPane(DataSource userDS, final ItemListGrid userListGrid) {

    this.userListGrid = userListGrid;
    setStyleName("defaultBorder");

    userViewer = new DetailViewer();
    userViewer.setDataSource(userDS);
    userViewer.setWidth100();
    userViewer.setMargin(25);
    userViewer.setEmptyMessage("Select an user to view its details");

    editorLabel = new Label();
    editorLabel.setWidth100();
    editorLabel.setHeight100();
    editorLabel.setAlign(Alignment.CENTER);
    editorLabel.setContents("Select an user to edit, or insert a new user into");

    insertLabel = new Label();
    insertLabel.setWidth100();
    insertLabel.setHeight100();
    insertLabel.setAlign(Alignment.CENTER);
    insertLabel.setContents("Insert a new user into");

    // update form
    editorForm = new DynamicForm();
    editorForm.setWidth(650);
    editorForm.setMargin(25);
    editorForm.setNumCols(4);
    editorForm.setCellPadding(5);
    editorForm.setAutoFocus(false);
    editorForm.setDataSource(userDS);
    editorForm.setUseAllDataSourceFields(true);

    userId = new StaticTextItem("userId", "User ID");
    userName = new TextItem("userName", "User Name");
    password = new PasswordItem("password", "Password");
    enabled = new CheckboxItem("enabled", "Enabled");

    userName.setRequired(true);
    password.setRequired(true);

    ButtonItem saveButton = new ButtonItem("saveUser", "Update user info.");
    saveButton.setAlign(Alignment.CENTER);
    saveButton.setWidth(100);
    saveButton.setColSpan(4);
    saveButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            // editorForm.saveData();

            if (userId.getValue() == null) {
              return;
            }

            if (!editorForm.validate(false)) {
              return;
            }
            User user = new User();

            user.setUserId((String) userId.getValue());
            user.setUserName(userName.getValueAsString());
            user.setPassword(password.getValueAsString());
            user.setEnabled(enabled.getValueAsBoolean());

            userService.updateUser(
                user,
                new AsyncCallback<Void>() {
                  public void onFailure(Throwable caught) {
                    SC.say("Error", "Server side error occured. Contact your administrator.");
                  }

                  public void onSuccess(Void noAnswer) {
                    SC.say("Updated", "User info. is updated.");

                    userListGrid.invalidateCache();
                  }
                });
          }
        });

    editorForm.setFields(userId, userName, password, enabled, saveButton);
    editorForm.setColWidths(100, 200, 100, 200);

    // insert form
    insertForm = new DynamicForm();
    insertForm.setWidth(650);
    insertForm.setMargin(25);
    insertForm.setNumCols(4);
    insertForm.setCellPadding(5);
    insertForm.setAutoFocus(false);
    insertForm.setDataSource(userDS);
    insertForm.setUseAllDataSourceFields(true);

    userId4add = new TextItem("userId", "User ID");
    userName4add = new TextItem("userName", "User Name");
    password4add = new PasswordItem("password", "Password");
    enabled4add = new CheckboxItem("enabled", "Enabled");

    enabled4add.setValue(true);
    userId4add.setRequired(true);
    userName4add.setRequired(true);
    password4add.setRequired(true);

    ButtonItem addButton = new ButtonItem("addUser", "Add user info.");
    addButton.setAlign(Alignment.CENTER);
    addButton.setWidth(100);
    addButton.setColSpan(4);
    addButton.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {

            if (!insertForm.validate(false)) {
              return;
            }

            User user = new User();

            user.setUserId(userId4add.getValueAsString());
            user.setUserName(userName4add.getValueAsString());
            user.setPassword(password4add.getValueAsString());
            user.setEnabled(enabled4add.getValueAsBoolean());

            userService.addUser(
                user,
                new AsyncCallback<Void>() {
                  public void onFailure(Throwable caught) {
                    SC.say("Error", "Server side error occured. Contact your administrator.");
                  }

                  public void onSuccess(Void noAnswer) {
                    SC.say("Added", "User info. is added.");

                    userListGrid.invalidateCache();
                    insertForm.clearValues();
                  }
                });
          }
        });

    insertForm.setFields(userId4add, userName4add, password4add, enabled4add, addButton);
    insertForm.setColWidths(100, 200, 100, 200);

    // tab
    Tab viewTab = new Tab("View");
    viewTab.setIcon("silk/application_form.png");
    viewTab.setWidth(70);
    viewTab.setPane(userViewer);

    Tab editTab = new Tab("Edit");
    editTab.setIcon("demoApp/icon_edit.png");
    editTab.setWidth(70);
    editTab.setPane(editorForm);

    Tab insertTab = new Tab("Add");
    insertTab.setIcon("demoApp/icon_add.png");
    insertTab.setWidth(70);
    insertTab.setPane(insertForm);

    setTabs(viewTab, editTab, insertTab);

    addTabSelectedHandler(
        new TabSelectedHandler() {
          public void onTabSelected(TabSelectedEvent event) {
            updateDetails();
          }
        });
  }
  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;
  }