예제 #1
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);
  }
  public void onValueChange(ValueChangeEvent<String> event) {
    String token = event.getValue();
    if (token != null) {
      String page = BLCLaunch.getSelectedPage(token);
      String moduleName = BLCLaunch.getSelectedModule(token);

      LinkedHashMap<String, String[]> pages = modules.get(moduleName).getPages();
      if (SecurityManager.getInstance().isUserAuthorizedToViewModule(moduleName)
          && SecurityManager.getInstance().isUserAuthorizedToViewSection(pages.get(page)[0])) {

        if (moduleName != null && !moduleName.equals(BLCMain.currentModuleKey)) {
          BLCMain.setCurrentModuleKey(moduleName);
          selectPrimaryMenu(moduleName);
          buildSecondaryMenu(page, moduleName);
          AppController.getInstance().clearCurrentView();
        } else {
          AppController.getInstance().clearCurrentView();
          buildSecondaryMenu(page, moduleName);
        }
      }
    }
  }
  public UserPermissionView(Boolean canReorder, Boolean canEdit) {
    setHeight100();
    setWidth100();
    setBackgroundColor("#eaeaea");
    setOverflow(Overflow.AUTO);

    HStack hStack = new HStack(10);
    hStack.setID("userPermissionHStack");

    hStack.setHeight("45%");
    hStack.setWidth100();
    hStack.setBackgroundColor("#eaeaea");
    hStack.setAlign(Alignment.CENTER);

    VLayout stack = new VLayout();
    stack.setID("userPermissionVerticalLayout");
    stack.setHeight100();
    stack.setWidth100();

    toolBar = new ToolStrip();
    toolBar.setHeight(30);
    toolBar.setWidth100();
    toolBar.setMinWidth(300);
    toolBar.addSpacer(6);
    addButton = new ToolStripButton();
    addButton.setTitle(BLCMain.getMessageManager().getString("addTitle"));
    addButton.setIcon(GWT.getModuleBaseURL() + "sc/skins/Enterprise/images/actions/add.png");
    addButton.setDisabled(true);
    toolBar.addButton(addButton);
    removeButton = new ToolStripButton();
    removeButton.setTitle(BLCMain.getMessageManager().getString("removeTitle"));
    removeButton.setIcon(GWT.getModuleBaseURL() + "sc/skins/Enterprise/images/actions/remove.png");
    removeButton.setDisabled(true);
    toolBar.addButton(removeButton);
    toolBar.addSpacer(6);
    toolBar.setDisabled(false);
    toolBar.addFill();
    stack.addMember(toolBar);

    grid = new ListGrid();
    grid.setAutoFetchData(false);
    grid.setShowHeader(true);
    grid.setShowHeaderContextMenu(false);
    grid.setPreventDuplicates(true);
    grid.setCanReorderRecords(canReorder);
    grid.setDisabled(true);
    grid.setCanSort(false);
    grid.setCellPadding(5);
    grid.setCanEdit(canEdit);
    grid.setEditEvent(ListGridEditEvent.DOUBLECLICK);
    grid.setEditByCell(true);
    grid.setAutoSaveEdits(true);
    grid.setSaveByCell(true);
    grid.setAlternateRecordStyles(true);
    grid.setCanGroupBy(false);
    if (!canEdit) {
      grid.setAlternateBodyStyleName("editRowDisabled");
    }
    stack.addMember(grid);

    hStack.addMember(stack);
    hStack.setOverflow(Overflow.AUTO);

    addMember(hStack);
  }
  public SplashWindow(String backgroundImage, String version) {
    setShowShadow(true);
    setBackgroundImage(backgroundImage);
    setShowEdges(false);
    setWidth(447);
    setHeight(257);
    setShowMinimizeButton(false);
    setShowTitle(false);
    setShowHeader(false);
    setIsModal(true);
    centerInPage();
    setShowCloseButton(false);
    VLayout layout = new VLayout();
    VLayout spacer = new VLayout();
    spacer.setHeight(90);
    layout.addMember(spacer);
    HLayout versionLayout = new HLayout();
    versionLayout.setAlign(Alignment.LEFT);
    versionLayout.setHeight(15);
    HLayout spacer3 = new HLayout();
    spacer3.setWidth(25);
    versionLayout.addMember(spacer3);
    VLayout temp = new VLayout(5);
    Label versionLabel =
        new Label(
            "Core Version: "
                + BLCMain.getMessageManager().getString("openAdminVersion")
                + "/"
                + BLCMain.getMessageManager().getString("buildDate"));
    versionLabel.setWrap(false);
    versionLabel.setStyleName("versionStyle");
    versionLabel.setHeight(15);
    temp.addMember(versionLabel);

    buildDateLabel = new Label("&nbsp;");
    buildDateLabel.setWrap(false);
    buildDateLabel.setStyleName("versionStyle");
    buildDateLabel.setHeight(15);

    temp.addMember(buildDateLabel);
    versionLayout.addMember(temp);
    layout.addMember(versionLayout);
    VLayout spacer2 = new VLayout();
    spacer2.setHeight(10);
    layout.addMember(spacer2);
    HLayout progressLayout = new HLayout();
    progressLayout.setAlign(Alignment.CENTER);
    simpleProgress = new SimpleProgress(24);
    simpleProgress.setWidth(417);
    progressLayout.addMember(simpleProgress);
    layout.addMember(progressLayout);
    setBorder("1px solid #3b4726");
    addItem(layout);

    KeyIdentifier escapeKey = new KeyIdentifier();
    escapeKey.setKeyName(KeyNames.ESC);
    Page.registerKey(
        escapeKey,
        new KeyCallback() {
          public void execute(String keyName) {
            SplashWindow.this.hide();
          }
        });
  }
 protected void showClientBuildDate() {
   String clientBuildDate = BLCMain.getMessageManager().getString("clientBuildDate");
   if (!clientBuildDate.equals("${clientBuildDate}")) {
     buildDateLabel.setContents("Build Date: " + clientBuildDate);
   }
 }
  protected void initItem(int width, int height) {
    String legacyHtml = "";
    if (toolBar != null) {
      toolBar.removeFromParent();
    }
    if (textArea != null) {
      legacyHtml = textArea.getHTML();
      textArea.removeFromParent();
    }
    if (mainLayout != null) {
      removeItem(mainLayout);
      mainLayout.destroy();
    }
    textArea = new RichTextArea();
    toolBar = new RichTextToolbar(textArea, DisplayType.DETAILED);

    saveButton = new IButton(BLCMain.getMessageManager().getString("ok"));
    IButton cancelButton = new IButton(BLCMain.getMessageManager().getString("cancel"));
    cancelButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            hide();
          }
        });

    final HtmlEditingPresenter pp = HtmlEditingPresenter.getInstance();

    final HLayout buttonsLayout = new HLayout(10);
    buttonsLayout.setAlign(Alignment.CENTER);
    buttonsLayout.addMember(saveButton);
    buttonsLayout.addMember(cancelButton);
    buttonsLayout.setLayoutTopMargin(2);
    buttonsLayout.setLayoutBottomMargin(2);
    buttonsLayout.setWidth100();
    buttonsLayout.setHeight(25);

    mainLayout = new VLayout();
    mainLayout.setWidth100();
    mainLayout.setHeight100();

    toolBar.setHeight("60px");
    final VLayout toolbarLayout = new VLayout();
    toolbarLayout.setWidth100();
    toolbarLayout.setHeight(60);
    toolbarLayout.addMember(toolBar);

    int textHeight = height - 130;
    textArea.setHeight(textHeight + "px");
    textArea.setWidth(width + "px");
    final VLayout textAreaLayout = new VLayout();
    textAreaLayout.setWidth100();
    textAreaLayout.setHeight(textHeight);
    textAreaLayout.addMember(textArea);

    mainLayout.addMember(toolbarLayout);
    mainLayout.addMember(textAreaLayout);
    mainLayout.addMember(buttonsLayout);
    addItem(mainLayout);

    toolBar.addAssetHandler(
        new Command() {
          @Override
          public void execute() {
            pp.displayAssetSearchDialog(toolBar);
          }
        });

    textArea.setHTML(legacyHtml);

    saveButton.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {
            if (richTextItem != null) {
              richTextItem.setValue(toolBar.getHTML());
              richTextItem.getForm().fireEvent(new ItemChangedEvent(richTextItem.getJsObj()));
            }
            hide();
          }
        });
  }