Esempio n. 1
0
  public ProfileDialog() {

    this.setWidget(uiBinder.createAndBindUi(this));
    this.addDialogListener(this);
    addStyleName(Css.PROFILE_DIALOG_BOX);

    profileLink.setText(Msg.consts.edit_profile());
    passwordLink.setText(Msg.consts.edit_password());
    portraitLink.setText(Msg.consts.edit_portrait());
    statusText.setHint(Msg.consts.user_status_hint());

    profileLink.addClickHandler(this);
    passwordLink.addClickHandler(this);
    portraitLink.addClickHandler(this);
    statusText.addChangeHandler(this);
    form1.addListener(this);
    form2.addListener(this);
    form3.addListener(this);

    editDeck.insert(form1, 1);
    editDeck.insert(form2, 2);
    editDeck.insert(form3, 3);

    deck.showWidget(0);

    resetTitle("");
    this.setIcon(ButtonIconBundle.userImage());

    // refresh page
    SecurityControllerAsync securityController = ControllerFactory.getSecurityController();
    // give -1 to get current login user
    securityController.getUser(-1, this);
  }
Esempio n. 2
0
  public void onSuccess(UserModel user) {
    deck.showWidget(1);

    if (!GwtClientUtils.preSuccessCheck(user, null)) {
      return;
    }

    // user exist - then fill all user information form and display information.
    if (user.getUid() != null && user.getUid() > 0) {
      fillPanel(user);
      form1.fillFields(user);
      form2.fillFields(user);
      form3.fillFields(user);
      editDeck.showWidget(0);
    }
    // image loading and center
    Scheduler.get()
        .scheduleDeferred(
            new ScheduledCommand() {
              public void execute() {
                ProfileDialog.this.center();
              }
            });
    // TODO: user not exist, error message display
  }
Esempio n. 3
0
  public MainContainer() {
    initWidget(uiBinder.createAndBindUi(this));
    deck.add(flow);
    deck.add(new Label("Deck 1"));
    final Label label2 = new Label("Deck 2");
    label2.setType(LabelType.WARNING);
    deck.add(label2);
    final Label label3 = new Label("Deck 3");
    label3.setType(LabelType.DANGER);
    deck.add(label3);

    scroll.getElement().getStyle().setOverflowX(Overflow.AUTO);
    scroll.getElement().getStyle().setOverflowY(Overflow.SCROLL);

    // scroll.setTouchScrollingDisabled(false);
    // NotifyUser.info("Touch enabled: " + !scroll.isTouchScrollingDisabled());

    // getScrollableElement().getStyle().setOverflowX(Overflow.HIDDEN);
    // scroll.getScrollableElement().getStyle().setOverflowY(Overflow.SCROLL);
    //
    // scroll.addScrollHandler(new ScrollHandler() {
    //
    // @Override
    // public void onScroll(final ScrollEvent event) {
    // // NotifyUser.info("scrolling");
    // }
    // });

    // addTouchEndHandler(new TouchEndHandler() {
    // @Override
    // public void onTouchEnd(final TouchEndEvent event) {
    // // NotifyUser.info("Touch end event");
    // next();
    // }
    // });
    // addTouchStartHandler(new TouchStartHandler() {
    // @Override
    // public void onTouchStart(final TouchStartEvent event) {
    // // NotifyUser.info("Touch start event");
    // }
    // });
    // addTouchCancelHandler(new TouchCancelHandler() {
    // @Override
    // public void onTouchCancel(final TouchCancelEvent event) {
    // // NotifyUser.info("Touch cancel event");
    // }
    // });
    // addTouchMoveHandler(new TouchMoveHandler() {
    // @Override
    // public void onTouchMove(final TouchMoveEvent event) {
    // // NotifyUser.info("Touch move event");
    //
    // }
    // });
  }
Esempio n. 4
0
  @Override
  public void addChild(Element ele) {
    super.addChild(ele);
    this.container.add((Widget) ((XulComponent) ele).getManagedObject());

    // sync with selectedIndex
    if (this.container.getVisibleWidget() != selectedIndex
        && selectedIndex < container.getWidgetCount()) {
      container.showWidget(selectedIndex);
    }
  }
Esempio n. 5
0
  @Bindable
  public void setSelectedIndex(int index) {
    int previousVal = selectedIndex;
    if (index < container.getWidgetCount() && index >= 0) {
      container.showWidget(index);
      notifyOnShow(this);
    }

    selectedIndex = index;
    this.firePropertyChange("selectedIndex", previousVal, index);
  }
Esempio n. 6
0
 public void onClick(ClickEvent event) {
   Object sender = event.getSource();
   if (sender == profileLink) {
     editDeck.showWidget(1);
   } else if (sender == passwordLink) {
     editDeck.showWidget(2);
   } else if (sender == portraitLink) {
     editDeck.showWidget(3);
   } else {
     editDeck.showWidget(0);
   }
 }
Esempio n. 7
0
    @Override
    public void add(final ReificationWidget widget) {
      boolean isContainer = widget.getInteractionUnit() instanceof Container;
      if (isContainer) numChildContainers++;

      if (numChildContainers > 2)
        throw new IllegalStateException(
            "Operator.SuspendResume only supports a single child container");

      deckPanel.add(widget.asWidget());
      index2child.put(deckPanel.getWidgetCount() - 1, widget.getInteractionUnit().getId());
    }
Esempio n. 8
0
 private void setupDeployerDeckPanel() {
   deployerDeckPanel.add(appBrowserPanel);
   deployerDeckPanel.add(projectOptionsPanel);
   deployerDeckPanel.add(databaseOptionsPanel);
   deployerDeckPanel.add(deploymentOptionsPanel);
   appBrowserPanel.setTitle("Application Browser");
   projectOptionsPanel.setTitle("Project Options");
   databaseOptionsPanel.setTitle("Database Options");
   deploymentOptionsPanel.setTitle("Deployment Options");
   deployerDeckPanel.showWidget(0);
   appBrowserPanel.setHeight("");
   appBrowserPanel.setWidth("");
 }
Esempio n. 9
0
  public Widget asWidget() {

    deck = new DeckPanel();

    deck.add(new ConnectionStep1(this).asWidget());

    /*step2 = new ConnectionStep2(this);
    deck.add(step2.asWidget());*/

    deck.showWidget(0);

    return deck;
  }
Esempio n. 10
0
  public void userUpdated(UserModel model) {

    // reset profileForm value
    form1.fillFields(model);
    fillPanel(model);
    editDeck.showWidget(0);
  }
Esempio n. 11
0
  private void setupSettingsPanel() {
    SplitLayoutPanel root = (SplitLayoutPanel) widget;
    root.setWidgetToggleDisplayAllowed(settingsPanel, true);
    testsMetricsPanel.showWidget(0);

    sessionPlotPanel = new SessionPlotPanel(plotPanel);
    sessionScopePlotList.add(sessionPlotPanel);
  }
Esempio n. 12
0
  private void init() {
    // TODO Auto-generated method stub
    main = new FlowPanel();
    initWidget(main);

    header = new UIHomeHeader();
    main.add(header);

    container = new DeckPanel();
    container.setAnimationEnabled(true);
    main.add(container);

    uiPrestamo = new UIPrestamoImpl(this);
    container.add(uiPrestamo);

    uiMantPrestamo = new UIMantPrestamoImpl(this);
    container.add(uiMantPrestamo);

    uiCliente = new UIClienteImpl(this);
    container.add(uiCliente);

    uiAmortizacion = new UIAmortizacionImpl(this);
    container.add(uiAmortizacion);

    uiMantAmortizacion = new UIMantAmortizacionImpl(this);
    container.add(uiMantAmortizacion);

    container.showWidget(0);
    uiPrestamo.scrollPanel.refresh();
  }
  private Widget createRecurrencePanel() {

    CaptionPanel recurrenceGB = new CaptionPanel(Messages.getString("schedule.recurrencePattern"));
    recurrenceGB.setStyleName(SCHEDULE_EDITOR_CAPTION_PANEL);

    deckPanel = new DeckPanel();
    recurrenceGB.add(deckPanel);

    secondlyEditor = new SecondlyRecurrenceEditor();
    minutelyEditor = new MinutelyRecurrenceEditor();
    hourlyEditor = new HourlyRecurrenceEditor();
    dailyEditor = new DailyRecurrenceEditor();
    weeklyEditor = new WeeklyRecurrenceEditor();
    monthlyEditor = new MonthlyRecurrenceEditor();
    yearlyEditor = new YearlyRecurrenceEditor();

    createTemporalMap();

    deckPanel.add(secondlyEditor);
    deckPanel.add(minutelyEditor);
    deckPanel.add(hourlyEditor);

    deckPanel.add(dailyEditor);
    deckPanel.add(weeklyEditor);
    deckPanel.add(monthlyEditor);
    deckPanel.add(yearlyEditor);

    deckPanel.showWidget(0);

    return recurrenceGB;
  }
Esempio n. 14
0
 private void reset() {
   projectOptionsPanel.reset();
   appBrowserPanel.reset();
   databaseOptionsPanel.reset();
   deploymentOptionsPanel.reset();
   setupBreadCrumbs();
   deployerDeckPanel.showWidget(0);
   currentPanelIndex = 0;
 }
 private void selectTemporalPanel(TemporalValue selectedTemporalValue) {
   int i = 0;
   for (Map.Entry<TemporalValue, Panel> me : temporalPanelMap.entrySet()) {
     if (me.getKey().equals(selectedTemporalValue)) {
       deckPanel.showWidget(i);
       break;
     }
     i++;
   }
 }
Esempio n. 16
0
  private void onMetricsTabSelected() {

    testsMetricsPanel.showWidget(1);
    mainTabPanel.forceLayout();
    for (String plotId : chosenPlots.keySet()) {
      if (plotPanel.getElementById(plotId) == null) {
        renderPlots(plotPanel, chosenPlots.get(plotId), plotId);
        scrollPanelMetrics.scrollToBottom();
      }
    }
  }
Esempio n. 17
0
  public void updateStemPlot(String latex) {
    btnOptions.setVisible(false);
    btnExport.setVisible(false);

    String latexStr = DrawEquationWeb.inputLatexCosmetics(latex);
    if (app.has(Feature.JLM_IN_WEB)) {
      DrawEquationWeb.paintOnCanvas(sample, latexStr, latexCanvas, app.getFontSize());

    } else {

      imageContainer.setText("");
      DrawEquationWeb.drawEquationAlgebraView(
          imageContainer.getElement(), "\\mathrm {" + latexStr + "}", true);
    }

    if (hasControlPanel) {
      controlDecks.showWidget(STEM_IDX);
    }

    displayDeckPanel.showWidget(IMAGE_IDX);
  }
 private void start() {
   if (currentShownWidget == UNPRESSED_DECK) {
     buttonPanel.showWidget(PRESSED_DECK);
     setCurrentShownWidget(PRESSED_DECK);
     Timer timer =
         new Timer() {
           public void run() {
             stop();
           }
         };
     timer.schedule(EXPIRATION_DURATION);
   }
 }
Esempio n. 19
0
 private void onTrendsTabSelected() {
   testsMetricsPanel.showWidget(0);
   mainTabPanel.forceLayout();
   if (!chosenMetrics.isEmpty() && hasChanged) {
     plotTrendsPanel.clear();
     for (Map.Entry<String, MetricDto> entry : chosenMetrics.entrySet()) {
       renderPlots(
           plotTrendsPanel,
           Arrays.asList(entry.getValue().getPlotSeriesDto()),
           entry.getKey(),
           entry.getValue().getPlotSeriesDto().getYAxisMin(),
           true);
     }
     scrollPanelTrends.scrollToBottom();
     hasChanged = false;
   }
 }
 public ProgressIndicatorWidget(Widget widget) {
   managedObject = widget;
   buttonPanel = new DeckPanel();
   buttonPanel.add(managedObject);
   buttonPanel.setWidth("100%");
   buttonPanel.setHeight("100%");
   managedObject.setWidth("auto");
   managedObject.setStylePrimaryName("pentaho-button");
   Image image = new Image(GWT.getModuleBaseURL() + "images/progress_spinner.gif"); // $NON-NLS-1$
   image.setStylePrimaryName("progress-image");
   image.setWidth("auto");
   image.setHeight("auto");
   buttonPanel.add(image);
   buttonPanel.setStylePrimaryName("progress-indicator-button");
   this.setWidget(buttonPanel);
   this.setHeight("100%");
   this.setWidth("auto");
   buttonPanel.showWidget(UNPRESSED_DECK);
 }
Esempio n. 21
0
 private void onSummaryTabSelected() {
   mainTabPanel.forceLayout();
   testsMetricsPanel.showWidget(0);
   // to make columns fit 100% width if grid created not on Summary Tab
   summaryPanel.getSessionComparisonPanel().refresh();
 }
Esempio n. 22
0
  public void onModuleLoad() {

    History.addValueChangeHandler(
        new ValueChangeHandler<String>() {
          @Override
          public void onValueChange(ValueChangeEvent<String> event) {
            final String token = event.getValue();
            handleHistoryChange(token);
          }
        });

    taskListsPage = new Page("Task Lists");
    tasksPage = new Page("Tasks");

    _taskService.getLogoutUrl(
        "/",
        new AsyncCallback<String>() {
          @Override
          public void onFailure(Throwable caught) {
            // do nothing
          }

          @Override
          public void onSuccess(String result) {
            RootPanel navigation = RootPanel.get("navigation");
            Anchor logoutLink = new Anchor("Logout", result);
            navigation.add(logoutLink);
          }
        });

    taskListsPage.addCreateItemHandler(
        new CreateItemHandler() {
          @Override
          public void onItemCreated(CreateItemEvent event) {
            AsyncCallback<TaskList> callback =
                new AsyncCallback<TaskList>() {
                  @Override
                  public void onFailure(final Throwable caught) {
                    Window.alert("creating task list failed: " + caught.getLocalizedMessage());
                  }

                  @Override
                  public void onSuccess(final TaskList taskList) {
                    final PageItem item =
                        new PageItem(
                            taskList.getName(),
                            HistoryTokens.LIST + HistoryTokens.SEP + taskList.getId());
                    item.setDeleteCommand(
                        new Command() {
                          @Override
                          public void execute() {
                            _taskService.deleteTaskList(
                                taskList.getId(),
                                new AsyncCallback<Void>() {
                                  @Override
                                  public void onFailure(Throwable caught) {
                                    // TODO inform user
                                  }

                                  @Override
                                  public void onSuccess(Void result) {
                                    taskListsPage.remove(item);
                                  }
                                });
                          }
                        });
                    taskListsPage.add(item);
                  }
                };
            _taskService.createTaskList(event.getItemName(), callback);
          }
        });

    tasksPage.addCreateItemHandler(
        new CreateItemHandler() {
          @Override
          public void onItemCreated(CreateItemEvent event) {
            AsyncCallback<Task> callback =
                new AsyncCallback<Task>() {
                  @Override
                  public void onFailure(final Throwable caught) {
                    Window.alert("creating task failed: " + caught.getLocalizedMessage());
                  }

                  @Override
                  public void onSuccess(final Task task) {
                    final PageItem item =
                        new PageItem(
                            task.getName(), HistoryTokens.TASK + HistoryTokens.SEP + task.getId());
                    item.setDeleteCommand(
                        new Command() {
                          @Override
                          public void execute() {
                            _taskService.deleteTask(
                                task.getId(),
                                new AsyncCallback<Void>() {
                                  @Override
                                  public void onFailure(Throwable caught) {
                                    GWT.log("remove failed");
                                    // TODO inform user
                                  }

                                  @Override
                                  public void onSuccess(Void result) {
                                    tasksPage.remove(item);
                                  }
                                });
                          }
                        });
                    tasksPage.add(item);
                  }
                };
            _taskService.createTask(event.getItemName(), _currentTaskListKey, callback);
          }
        });

    mainPanel.add(new Label("Loading..."));
    mainPanel.add(taskListsPage);
    mainPanel.add(tasksPage);
    RootPanel.get("application").add(mainPanel);
    mainPanel.showWidget(0);
    handleInitialHistoryToken();
  }
Esempio n. 23
0
 public void userPasswordUpdated() {
   editDeck.showWidget(0);
 }
Esempio n. 24
0
 public void showPlotPanel() {
   displayDeckPanel.showWidget(METAPLOT_IDX);
 }
Esempio n. 25
0
 public void showNumClassesPanel() {
   controlDecks.showWidget(NUM_CLASSES_IDX);
 }
Esempio n. 26
0
 public void showManualClassesPanel() {
   controlDecks.showWidget(MANUAL_CLASSES_IDX);
 }
Esempio n. 27
0
 public void showInvalidDataDisplay() {
   //		imageContainer.setIcon(null);
   displayDeckPanel.showWidget(IMAGE_IDX);
 }
Esempio n. 28
0
  private void createGUI() {
    oldWidth = 0;
    oldHeight = 0;
    // create options button
    btnOptions =
        new MyToggleButton2(
            new NoDragImage(
                AppResources.INSTANCE.inputhelp_left_18x18().getSafeUri().asString(), 18));

    btnOptions.addClickHandler(
        new ClickHandler() {

          public void onClick(ClickEvent event) {
            actionPerformed(btnOptions);
          }
        });

    // create export button
    btnExport = new MenuBar();

    // create control panel
    if (hasControlPanel) {

      // create sub-control panels
      createDisplayTypeComboBox();
      createNumClassesPanel();
      createManualClassesPanel();
      createStemPlotAdjustmentPanel();
      FlowPanel emptyControl = new FlowPanel();
      emptyControl.add(new Label("  "));

      // put sub-control panels into a deck panel
      controlDecks = new DeckPanel();
      controlDecks.add(numClassesPanel);
      controlDecks.add(manualClassesPanel);
      controlDecks.add(stemAdjustPanel);
      controlDecks.add(emptyControl);

      FlowPanel buttonPanel = new FlowPanel();
      buttonPanel.setStyleName("daOptionButtons");
      buttonPanel.add(LayoutUtil.panelRow(btnOptions, btnExport));

      // control panel
      controlPanel = new FlowPanel();
      controlPanel.add(LayoutUtil.panelRow(lbDisplayType, controlDecks, buttonPanel));
    }

    createExportToEvAction();
    plotPanel = new PlotPanelEuclidianViewW(app.getKernel(), exportToEVAction);

    //		plotPanel.setPreferredSize(PLOTPANEL_WIDTH, PLOTPANEL_HEIGHT);
    //		plotPanel.updateSize();
    plotPanelNorth = new FlowPanel();
    plotPanelSouth = new FlowPanel();
    GColor bgColor = plotPanel.getBackgroundCommon();

    lblTitleX = new Label();
    lblTitleY = new Label();

    fldTitleX = (new InputPanelW(null, app, -1, false)).getTextComponent();
    fldTitleY = (new InputPanelW(null, app, -1, false)).getTextComponent();

    fldTitleX.setEditable(false);
    fldTitleY.setEditable(false);

    metaPlotPanel = new FlowPanel();
    metaPlotPanel.setStyleName("daDotPanel");
    metaPlotPanel.add(plotPanel.getComponent());

    createImagePanel();

    // put display panels into a deck panel

    displayDeckPanel = new DeckPanel();

    displayDeckPanel.add(metaPlotPanel);
    displayDeckPanel.add(new ScrollPanel(imagePanel));

    // create options panel
    optionsPanel = new OptionsPanelW(app, daModel, getModel());
    optionsPanel.setVisible(false);

    frequencyTable = new FrequencyTablePanelW(app);

    spFrequencyTable = new ScrollPanel();
    spFrequencyTable.add(frequencyTable);
    spFrequencyTable.setStyleName("spFrequencyTable");

    // =======================================
    // put all the panels together

    mainPanel = new FlowPanel();
    mainPanel.setStyleName("dataDisplayMain");
    if (hasControlPanel) {
      mainPanel.add(controlPanel);
    }
    mainPanel.add(LayoutUtil.panelRow(displayDeckPanel, optionsPanel));

    add(mainPanel);
    createExportMenu();
    resize();
  }
Esempio n. 29
0
 public void showControlPanel() {
   controlDecks.showWidget(EMPTY_IDX);
 }
Esempio n. 30
0
  public void userPortraitUpdated(String portraitUuid) {
    portrait.clear();
    portrait.setWidget(GwtClientUtils.createUserPortrait(portraitUuid));

    editDeck.showWidget(0);
  }