Ejemplo n.º 1
0
  protected void showNewPatternDialog() {
    final FormStylePopup pop = new FormStylePopup();
    pop.setTitle(constants.NewFactSelectTheType());
    final ListBox types = new ListBox();
    for (int i = 0; i < sce.getFactTypes().length; i++) {
      types.addItem(sce.getFactTypes()[i]);
    }
    pop.addAttribute(constants.FactType(), types);
    final TextBox binding = new TextBox();
    pop.addAttribute(constants.Binding(), binding);

    Button ok = new Button(constants.OK());
    ok.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent w) {
            editingCol.setBoundName(binding.getText());
            editingCol.setFactType(types.getItemText(types.getSelectedIndex()));
            editingCol.setFactField(null);
            makeLimitedValueWidget();
            doPatternLabel();
            doFieldLabel();
            pop.hide();
          }
        });
    pop.addAttribute("", ok);

    pop.show();
  }
Ejemplo n.º 2
0
  public WorkingSetSelectorPopup(RuleModeller m, RuleAsset a) {
    this.modeller = m;
    this.asset = a;

    pop = new FormStylePopup();
    Constants constants = ((Constants) GWT.create(Constants.class));
    pop.setTitle(constants.SelectWorkingSets());
    Grid g = buildDoubleList(null);

    RepositoryServiceFactory.getAssetService()
        .listAssets(
            asset.getMetaData().getPackageUUID(),
            new String[] {AssetFormats.WORKING_SET},
            0,
            -1,
            "workingsetList",
            new GenericCallback<TableDataResult>() {

              public void onSuccess(TableDataResult result) {

                for (int i = 0; i < result.data.length; i++) {
                  if (WorkingSetManager.getInstance()
                      .isWorkingSetActive(
                          asset.getMetaData().getPackageName(), result.data[i].id)) {
                    selectedFacts.addItem(result.data[i].getDisplayName(), result.data[i].id);
                  } else {
                    availableFacts.addItem(result.data[i].getDisplayName(), result.data[i].id);
                  }
                }
              }
            });

    Button save = new Button(constants.SaveAndClose());
    save.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {
            String[] wsUUIDs = new String[selectedFacts.getItemCount()];
            for (int i = 0; i < selectedFacts.getItemCount(); i++) {
              wsUUIDs[i] = selectedFacts.getValue(i);
            }

            WorkingSetManager.getInstance()
                .applyWorkingSets(
                    asset.getMetaData().getPackageName(),
                    wsUUIDs,
                    new Command() {
                      public void execute() {
                        LoadingPopup.close();
                        pop.hide();
                        modeller.refreshWidget();
                        modeller.verifyRule(null, true);
                      }
                    });
          }
        });

    pop.addRow(g);
    pop.addRow(save);
  }
Ejemplo n.º 3
0
  public void openAdministrationSelection(int id) {

    switch (id) {
      case 0:
        if (!explorerViewCenterPanel.showIfOpen(CATMAN)) {
          explorerViewCenterPanel.addTab(
              constants.CategoryManager(), new CategoryManager(), CATMAN);
        }
        break;
      case 1:
        if (!explorerViewCenterPanel.showIfOpen(ARCHMAN)) {
          explorerViewCenterPanel.addTab(
              constants.ArchivedManager(), new ArchivedAssetManager(), ARCHMAN);
        }
        break;

      case 2:
        if (!explorerViewCenterPanel.showIfOpen(STATEMAN)) {
          explorerViewCenterPanel.addTab(constants.StateManager(), new StateManager(), STATEMAN);
        }
        break;
      case 3:
        if (!explorerViewCenterPanel.showIfOpen(BAKMAN)) {
          explorerViewCenterPanel.addTab(constants.ImportExport(), new BackupManager(), BAKMAN);
        }
        break;

      case 4:
        if (!explorerViewCenterPanel.showIfOpen(ERROR_LOG)) {
          explorerViewCenterPanel.addTab(constants.EventLog(), new LogViewer(), ERROR_LOG);
        }
        break;
      case 5:
        if (!explorerViewCenterPanel.showIfOpen(SECURITY_PERMISSIONS)) {
          explorerViewCenterPanel.addTab(
              constants.UserPermissionMappings(), new PermissionViewer(), SECURITY_PERMISSIONS);
        }
        break;
      case 6:
        Frame aboutInfoFrame = new Frame("../AboutInfo.html"); // NON-NLS

        FormStylePopup aboutPop = new FormStylePopup();
        aboutPop.setWidth(600 + "px");
        aboutPop.setTitle(constants.About());
        String hhurl = GWT.getModuleBaseURL() + "webdav";
        aboutPop.addAttribute(constants.WebDAVURL() + ":", new SmallLabel("<b>" + hhurl + "</b>"));
        aboutPop.addAttribute(constants.Version() + ":", aboutInfoFrame);
        aboutPop.show();
        break;

      case 7:
        if (!explorerViewCenterPanel.showIfOpen(RULE_VERIFIER_MANAGER)) {
          explorerViewCenterPanel.addTab(
              constants.RulesVerificationManager(),
              new RuleVerifierManager(),
              RULE_VERIFIER_MANAGER);
        }
        break;
      case 8:
        if (!explorerViewCenterPanel.showIfOpen(REPOCONFIG))
          explorerViewCenterPanel.addTab(
              constants.RepositoryConfig(), new RepoConfigManager(), REPOCONFIG);
        break;
      case 9:
        if (!explorerViewCenterPanel.showIfOpen(WORKSPACES))
          explorerViewCenterPanel.addTab(
              constants.Workspaces(), new WorkspaceManager(), WORKSPACES);
        break;
      case 10:
        openPerspectivesManager();
        break;
    }
  }