Exemplo n.º 1
0
 private SimplePanel horizontalWrapper(IsWidget child, String width) {
   SimplePanel wrapper = new SimplePanel(child.asWidget());
   wrapper.setStyleName("goon-horizontalWrapper");
   Style style = wrapper.getElement().getStyle();
   style.setProperty("display", "table-cell");
   if (childTextAlign != null) style.setTextAlign(childTextAlign);
   if (width != null) wrapper.setWidth(width);
   return wrapper;
 }
Exemplo n.º 2
0
  public EditorController(String divID, int width, int height) {

    VerticalPanel vp = new VerticalPanel();
    HorizontalPanel hp = new HorizontalPanel();

    SimplePanel topToolBoxWrapper = new SimplePanel();

    ToggleButtonListener toggleButtonListener = new ToggleButtonListener();

    topToolBox = new TopToolBox(this, toggleButtonListener);
    topToolBox.setStyleName("jsmoleditor-topToolBox");

    topToolBoxWrapper.setWidget(topToolBox);
    topToolBoxWrapper.setStyleName("jsmoleditor-topTooBoxWrapper");
    topToolBoxWrapper.setWidth(width + "px");

    SimplePanel sideToolBoxWrapper = new SimplePanel();
    elementToolBox = new ElementToolBox(this, toggleButtonListener);

    sideToolBoxWrapper.setWidget(elementToolBox);
    sideToolBoxWrapper.setStyleName("jsmoleditor-elementToolBoxWrapper");
    sideToolBoxWrapper.setHeight((height - 24) + "px");

    VerticalPanel vp2 = new VerticalPanel();

    ExtendedCanvas canvas = new ExtendedCanvas(width - 24, height - 48);
    StatusBar statusBar = new StatusBar(width - 24, 24);
    statusBar.setHTML("Copyright chemhack.com");
    renderer = new CanvasRenderer(this, canvas);

    vp2.add(canvas);
    vp2.add(statusBar);

    hp.add(sideToolBoxWrapper);
    hp.add(vp2);

    vp.add(topToolBoxWrapper);
    vp.add(hp);

    RootPanel rootPanel = RootPanel.get(divID);
    rootPanel.setPixelSize(width, height);
    rootPanel.add(vp);

    KeyboardShortCutEventPreview preview =
        new KeyboardShortCutEventPreview(this); // TODO deal with multiple editor instance?

    DOM.addEventPreview(preview);

    EditorMouseListener listener = new EditorMouseListener(this);
    canvas.addMouseListener(listener);
    canvas.addMouseWheelListener(listener);
  }
  public ValidationTextBox() {
    textBox = new TextBox();
    textBox.addKeyUpHandler(
        new KeyUpHandler() {

          @Override
          public void onKeyUp(KeyUpEvent event) {
            performValidation(true);
            fireOnKeyUp(event);
          }
        });

    imagePanel =
        new SimplePanel() {

          @Override
          public void onBrowserEvent(Event event) {
            super.onBrowserEvent(event);
            switch (DOM.eventGetType(event)) {
              case Event.ONMOUSEOVER:
                {
                  if (!validate()) {
                    showMessagePopup();
                  }
                  break;
                }

              case Event.ONMOUSEOUT:
                {
                  hideMessagePopup();
                  break;
                }
            }
          }
        };
    imagePanel.setStylePrimaryName("validation-textbox-image-panel"); // $NON-NLS-1$
    imagePanel.sinkEvents(Event.ONMOUSEOVER | Event.ONMOUSEOUT);
    this.add(textBox);
    textBox.setWidth("100%");
    this.setCellWidth(textBox, "100%");
    this.setStylePrimaryName("custom-text-box"); // $NON-NLS-1$
    SimplePanel hSpacer = new SimplePanel();
    hSpacer.setWidth("10px");
    this.add(hSpacer);
    image = new Image(GWT.getModuleBaseURL() + "images/spacer.gif"); // $NON-NLS-1$
    image.setStylePrimaryName("validation-textbox-image");
    imagePanel.add(image);
    imagePanel.addStyleDependentName("invalid");
    this.add(imagePanel);
  }
 public EmailAdminPanel() {
   dockPanel = new DockPanel();
   actionBar = new ActionBar();
   FlexTable mainPanel = new FlexTable();
   HorizontalPanel hPanel = new HorizontalPanel();
   SimplePanel hSpacer = new SimplePanel();
   hSpacer.setWidth("10px");
   hPanel.add(hSpacer);
   hPanel.add(new Label(Messages.getString("emailSmtpServer")));
   mainPanel.setWidget(0, 0, hPanel);
   hPanel = new HorizontalPanel();
   hSpacer = new SimplePanel();
   hSpacer.setWidth("10px");
   hPanel.add(hSpacer);
   hPanel.add(createEmailPanel());
   mainPanel.setWidget(1, 0, hPanel);
   dockPanel.add(mainPanel, DockPanel.CENTER);
   dockPanel.setCellWidth(mainPanel, "100%");
   saveButton = new Button(Messages.getString("save"));
   progressIndicator = new ProgressIndicatorWidget(saveButton);
   actionBar.addWidget(progressIndicator, HorizontalPanel.ALIGN_RIGHT);
   dockPanel.add(actionBar, DockPanel.SOUTH);
   dockPanel.setCellVerticalAlignment(actionBar, HorizontalPanel.ALIGN_BOTTOM);
   dockPanel.setCellWidth(actionBar, "100%");
   dockPanel.setCellHeight(actionBar, "100%");
   setWidget(dockPanel);
   dockPanel.setHeight("100%");
   dockPanel.setWidth("100%");
   this.setWidth("100%");
   this.setHeight("100%");
   if (isIE()) {
     saveButton.setEnabled(false);
   } else {
     actionBar.collapse(1);
   }
 }
Exemplo n.º 5
0
  public SectionTreeBoxView2() {
    addStyleName("Y-system-DialogBox");
    setGlassEnabled(false);
    setAnimationEnabled(true);
    setHTML("Drzewo sekcji");

    //		panel.setSize("100%", "100%");
    setWidget(panel);
    panel.setWidth("200px");

    panel.add(absolutePanel);

    SectionsTreeView sectionsTree = new SectionsTreeView();
    absolutePanel.add(sectionsTree);

    HTMLPanel buttonPanel = new HTMLPanel("");
    absolutePanel.add(buttonPanel);

    btnOk = new Button("Ok");
    buttonPanel.add(btnOk);

    btnOk.addClickHandler(
        new ClickHandler() {
          @Override
          public void onClick(ClickEvent event) {

            hide();
          }
        });

    btnCancel = new Button("Cancel");
    buttonPanel.add(btnCancel);
    btnCancel.addClickHandler(
        new ClickHandler() {
          public void onClick(ClickEvent event) {

            hide();
          }
        });

    center();
  }
Exemplo n.º 6
0
  public ScheduleEditor(ScheduleDialogType type) {
    super();
    isBlockoutDialog = (type == ScheduleDialogType.BLOCKOUT);
    startTimePicker = new TimePicker();

    setStylePrimaryName("scheduleEditor"); // $NON-NLS-1$

    scheduleCombo = createScheduleCombo();
    Label l = new Label(MSGS.recurrenceColon());
    l.setStyleName(SCHEDULE_LABEL);
    add(l);
    add(scheduleCombo);

    SimplePanel hspacer = new SimplePanel();
    hspacer.setWidth("100px"); // $NON-NLS-1$

    if (!isBlockoutDialog) {
      startTimePanel = createStartTimePanel();
      add(startTimePanel);
    } else {

      // Blockout End TimePicker
      blockoutEndTimePicker = new TimePicker();
      blockoutEndTimePicker.setHour("01"); // $NON-NLS-1$
      blockoutEndTimePicker.setMinute("00"); // $NON-NLS-1$
      blockoutEndTimePicker.setTimeOfDay(TimeUtil.TimeOfDay.PM);

      // Blockout End Caption Panel
      blockoutEndTimePicker.getElement().getStyle().setDisplay(Display.NONE);

      final String[] daysList = new String[365];
      final String[] hoursList = new String[24];
      final String[] minutesList = new String[60];

      // Populate list
      for (Integer i = 0; i < 365; i++) {
        String iStr = i.toString();
        daysList[i] = iStr;

        if (i < 60) {
          minutesList[i] = iStr;
          if (i < 24) {
            hoursList[i] = iStr;
          }
        }
      }

      // Units of time Drop Down
      daysListBox = new ListBox();
      daysListBox.getElement().setId("daysListBox"); // $NON-NLS-1$
      populateListItems(daysListBox, daysList, 0, 365);

      final Label daysLabel = new Label(MSGS.dayOrDays());
      daysLabel.getElement().setAttribute("for", daysListBox.getElement().getId()); // $NON-NLS-1$

      hoursListBox = new ListBox();
      hoursListBox.getElement().setId("hoursListBox"); // $NON-NLS-1$
      populateListItems(hoursListBox, hoursList, 0, 24);

      final Label hoursLabel = new Label(MSGS.hourOrHours());
      hoursLabel.getElement().setAttribute("for", hoursListBox.getElement().getId()); // $NON-NLS-1$

      minutesListBox = new ListBox();
      minutesListBox.getElement().setId("minutesListBox"); // $NON-NLS-1$
      populateListItems(minutesListBox, minutesList, 0, 60);

      final Label minutesLabel = new Label(MSGS.minuteOrMinutes());
      minutesLabel
          .getElement()
          .setAttribute("for", minutesListBox.getElement().getId()); // $NON-NLS-1$

      final HorizontalPanel durationPanel = new HorizontalPanel();
      durationPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
      durationPanel.setSpacing(blockoutEndTimePicker.getSpacing());
      durationPanel.add(daysListBox);
      durationPanel.add(daysLabel);
      durationPanel.add(hoursListBox);
      durationPanel.add(hoursLabel);
      durationPanel.add(minutesListBox);
      durationPanel.add(minutesLabel);

      // Bind change handler
      this.scheduleCombo.addChangeHandler(
          new ChangeHandler() {

            @Override
            public void onChange(ChangeEvent event) {
              String scheduleType = scheduleCombo.getItemText(scheduleCombo.getSelectedIndex());

              if (ScheduleType.RUN_ONCE.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 365);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.HOURS.toString().equals(scheduleType)) {
                hide(true, daysListBox, daysLabel, hoursListBox, hoursLabel);
                show(true, minutesListBox, minutesLabel);

                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.DAILY.toString().equals(scheduleType)) {
                hide(true, daysListBox, daysLabel);
                show(true, hoursListBox, hoursLabel, minutesListBox, minutesLabel);

                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.WEEKLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 7);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.MONTHLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 28);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);

              } else if (ScheduleType.YEARLY.toString().equals(scheduleType)) {
                show(
                    true,
                    daysListBox,
                    daysLabel,
                    hoursListBox,
                    hoursLabel,
                    minutesListBox,
                    minutesLabel);

                populateListItems(daysListBox, daysList, 0, 365);
                populateListItems(hoursListBox, hoursList, 0, 24);
                populateListItems(minutesListBox, minutesList, 0, 60);
              }
            }
          });

      /*
       * Radio Buttons for duration
       */
      this.durationRadioButton =
          new RadioButton("durationRadioGroup", "durationRadioButton"); // $NON-NLS-1$ //$NON-NLS-2$
      this.durationRadioButton.setText(MSGS.duration());
      this.durationRadioButton.setValue(Boolean.TRUE);
      this.durationRadioButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              blockoutEndTimePicker.getElement().getStyle().setDisplay(Display.NONE);
              durationPanel.getElement().getStyle().clearDisplay();
            }
          });

      this.endTimeRadioButton =
          new RadioButton("durationRadioGroup", "endTimeRadioButton"); // $NON-NLS-1$ //$NON-NLS-2$
      this.endTimeRadioButton.setText(MSGS.endTime());
      this.endTimeRadioButton.addClickHandler(
          new ClickHandler() {

            @Override
            public void onClick(ClickEvent event) {
              blockoutEndTimePicker.getElement().getStyle().clearDisplay();
              durationPanel.getElement().getStyle().setDisplay(Display.NONE);
            }
          });

      // Radio Buttons Panel
      HorizontalPanel radioButtonsPanel = new HorizontalPanel();
      radioButtonsPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
      radioButtonsPanel.add(this.durationRadioButton);
      radioButtonsPanel.add(this.endTimeRadioButton);

      // Ends Panel
      VerticalPanel endsPanel = new VerticalPanel();
      endsPanel.add(radioButtonsPanel);
      endsPanel.add(blockoutEndTimePicker);
      endsPanel.add(durationPanel);

      // Blockout period
      CaptionPanel blockoutStartCaptionPanel = new CaptionPanel(MSGS.startTime());
      HorizontalPanel blockoutStartPanel = new HorizontalPanel();
      blockoutStartPanel.add(getStartTimePicker());
      timeZonePicker = new ListBox();
      timeZonePicker.setStyleName("timeZonePicker");
      timeZonePicker.setVisibleItemCount(1);
      blockoutStartPanel.add(timeZonePicker);
      timeZonePicker.getElement().getParentElement().getStyle().setPaddingTop(5, Unit.PX);

      blockoutStartCaptionPanel.add(blockoutStartPanel);
      populateTimeZonePicker();

      // Ends Caption Panel
      CaptionPanel endCaptionPanel = new CaptionPanel(MSGS.endsCaptionTitle());
      endCaptionPanel.add(endsPanel);

      VerticalPanel blockoutPanel = new VerticalPanel();
      blockoutPanel.setWidth("100%"); // $NON-NLS-1$
      blockoutPanel.add(blockoutStartCaptionPanel);
      blockoutPanel.add(endCaptionPanel);

      add(blockoutPanel);
    }

    VerticalPanel vp = new VerticalPanel();
    vp.setWidth("100%"); // $NON-NLS-1$
    add(vp);
    setCellHeight(vp, "100%"); // $NON-NLS-1$

    runOnceEditor = new RunOnceEditor(startTimePicker);
    vp.add(runOnceEditor);
    scheduleTypeMap.put(ScheduleType.RUN_ONCE, runOnceEditor);
    runOnceEditor.setVisible(true);

    recurrenceEditor = new RecurrenceEditor(startTimePicker);
    vp.add(recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.SECONDS, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.MINUTES, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.HOURS, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.DAILY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.WEEKLY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.MONTHLY, recurrenceEditor);
    scheduleTypeMap.put(ScheduleType.YEARLY, recurrenceEditor);
    recurrenceEditor.setVisible(false);

    cronEditor = new CronEditor();
    scheduleTypeMap.put(ScheduleType.CRON, cronEditor);
    cronEditor.setVisible(false);

    if (!isBlockoutDialog) {
      vp.add(cronEditor);

      VerticalPanel blockoutButtonPanel = new VerticalPanel();
      blockoutButtonPanel.setWidth("100%"); // $NON-NLS-1$
      // blockoutButtonPanel.setHeight("30%");
      blockoutButtonPanel.setHorizontalAlignment(VerticalPanel.ALIGN_CENTER);
      blockoutButtonPanel.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);

      // We want to add a button to check for blockout conflicts
      blockoutCheckButton.setStyleName("pentaho-button"); // $NON-NLS-1$
      blockoutCheckButton.getElement().setId("blockout-check-button"); // $NON-NLS-1$
      blockoutCheckButton.setVisible(false);

      hspacer.setHeight("50px"); // $NON-NLS-1$
      blockoutButtonPanel.add(hspacer);
      blockoutButtonPanel.add(blockoutCheckButton);

      vp.add(hspacer);
      add(blockoutButtonPanel);
    }

    configureOnChangeHandler();
  }
  public com.google.gwt.user.client.ui.Widget createAndBindUi(
      final com.rhiscom.bpm.console.client.ui.process.ProcessManagementViewImpl owner) {

    com.rhiscom.bpm.console.client.ui.process.ProcessManagementViewImpl_BinderImpl_GenBundle
        clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay =
            (com.rhiscom.bpm.console.client.ui.process
                    .ProcessManagementViewImpl_BinderImpl_GenBundle)
                GWT.create(
                    com.rhiscom.bpm.console.client.ui.process
                        .ProcessManagementViewImpl_BinderImpl_GenBundle.class);
    com.rhiscom.bpm.console.client.ui.process.ProcessManagementViewImpl_BinderImpl_GenCss_style
        style = clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style();
    java.lang.String domId0 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.user.client.ui.MenuItem btnRefrescar =
        new com.google.gwt.user.client.ui.MenuItem("", (com.google.gwt.user.client.Command) null);
    com.google.gwt.user.client.ui.MenuBar menuBarProcesos =
        (com.google.gwt.user.client.ui.MenuBar)
            GWT.create(com.google.gwt.user.client.ui.MenuBar.class);
    com.google.gwt.user.client.ui.HorizontalPanel f_HorizontalPanel1 =
        (com.google.gwt.user.client.ui.HorizontalPanel)
            GWT.create(com.google.gwt.user.client.ui.HorizontalPanel.class);
    java.lang.String domId1 = com.google.gwt.dom.client.Document.get().createUniqueId();
    java.lang.String domId2 = com.google.gwt.dom.client.Document.get().createUniqueId();
    com.google.gwt.user.client.ui.FlexTable flexProcessTable =
        (com.google.gwt.user.client.ui.FlexTable)
            GWT.create(com.google.gwt.user.client.ui.FlexTable.class);
    com.google.gwt.user.client.ui.SimplePanel f_SimplePanel3 =
        (com.google.gwt.user.client.ui.SimplePanel)
            GWT.create(com.google.gwt.user.client.ui.SimplePanel.class);
    com.google.gwt.user.client.ui.HTMLPanel f_HTMLPanel2 =
        new com.google.gwt.user.client.ui.HTMLPanel(template.html1(domId2).asString());
    com.google.gwt.user.client.ui.HTMLPanel htmlPanel =
        new com.google.gwt.user.client.ui.HTMLPanel(template.html2(domId0, domId1).asString());

    btnRefrescar.setStyleName("" + style.gwtMenuItem() + "");
    btnRefrescar.setWidth("130px");
    btnRefrescar.setText("Refrescar definiciones");
    menuBarProcesos.addItem(btnRefrescar);
    menuBarProcesos.setAutoOpen(false);
    menuBarProcesos.setTitle("Main");
    menuBarProcesos.setAnimationEnabled(true);
    f_HorizontalPanel1.add(menuBarProcesos);
    f_HorizontalPanel1.setStyleName("" + style.rightHorizontalPanel() + "");
    f_HorizontalPanel1.setWidth("100%");
    flexProcessTable.setWidth("100%");
    flexProcessTable.setHeight("100%");
    f_SimplePanel3.add(flexProcessTable);
    f_SimplePanel3.setWidth("100%");
    f_SimplePanel3.setHeight("100%");
    f_HTMLPanel2.setWidth("100%");
    f_HTMLPanel2.setHeight("100%");

    UiBinderUtil.TempAttachment attachRecord0 = UiBinderUtil.attachToDom(htmlPanel.getElement());
    com.google.gwt.user.client.Element domId0Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId0).cast();
    UiBinderUtil.TempAttachment attachRecord1 = UiBinderUtil.attachToDom(f_HTMLPanel2.getElement());
    com.google.gwt.user.client.Element domId2Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId2).cast();
    attachRecord1.detach();
    f_HTMLPanel2.addAndReplaceElement(f_SimplePanel3, domId2Element);
    com.google.gwt.user.client.Element domId1Element =
        com.google.gwt.dom.client.Document.get().getElementById(domId1).cast();
    attachRecord0.detach();
    htmlPanel.addAndReplaceElement(f_HorizontalPanel1, domId0Element);
    htmlPanel.addAndReplaceElement(f_HTMLPanel2, domId1Element);

    owner.btnRefrescar = btnRefrescar;
    owner.flexProcessTable = flexProcessTable;
    clientBundleFieldNameUnlikelyToCollideWithUserSpecifiedFieldOkay.style().ensureInjected();

    return htmlPanel;
  }
Exemplo n.º 8
0
  private Widget getMainPanel() {
    SimplePanel panel = new SimplePanel();
    panel.setWidth("100%");
    panel.setHeight("100%");

    dataGrid = new DataGrid<RuleInfo>(MAX_RULES, RuleInfo.KEY_PROVIDER);
    dataGrid.setHeight(MAIN_HEIGHT);

    Column<RuleInfo, String> columnName =
        addColumn(
            new TextCell(),
            "Rule Name",
            new GetValue<String>() {
              public String getValue(RuleInfo rule) {
                return rule.getName();
              }
            },
            null);

    Column<RuleInfo, String> ruleType =
        addColumn(
            new TextCell(),
            "Type",
            new GetValue<String>() {
              public String getValue(RuleInfo rule) {
                return rule.getType().toUpperCase();
              }
            },
            null);

    Column<RuleInfo, ImageResource> ruleEnabled =
        addColumn(
            new ImageResourceCell(),
            "Enabled",
            new GetValue<ImageResource>() {
              public ImageResource getValue(RuleInfo rule) {
                if (rule.isEnabled()) {
                  return PgStudio.Images.trueBox();
                }
                return PgStudio.Images.falseBox();
              }
            },
            null);

    Column<RuleInfo, ImageResource> instead =
        addColumn(
            new ImageResourceCell(),
            "Instead",
            new GetValue<ImageResource>() {
              public ImageResource getValue(RuleInfo rule) {
                if (rule.isInstead()) {
                  return PgStudio.Images.trueBox();
                }
                return PgStudio.Images.falseBox();
              }
            },
            null);

    dataGrid.setColumnWidth(columnName, "200px");
    dataGrid.setColumnWidth(ruleType, "120px");
    dataGrid.setColumnWidth(ruleEnabled, "100px");
    dataGrid.setColumnWidth(instead, "100px");

    ruleType.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    ruleEnabled.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
    instead.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);

    dataGrid.setLoadingIndicator(new Image(PgStudio.Images.spinner()));

    dataProvider.addDataDisplay(dataGrid);

    dataGrid.setSelectionModel(selectionModel);
    selectionModel.addSelectionChangeHandler(
        (new SelectionChangeEvent.Handler() {
          @Override
          public void onSelectionChange(SelectionChangeEvent event) {
            RuleInfo rule = selectionModel.getSelectedObject();
            ruleDef.setText(rule.getDefinition());
          }
        }));

    panel.add(dataGrid);

    return panel.asWidget();
  }
Exemplo n.º 9
0
  /**
   * Constructs <code>CustomVideoPlayer</code> with the specified {@code height} and {@code width}
   * using the specified {@code playerPlugin} to playback media located at {@code mediaURL}. Media
   * playback begins automatically if {@code autoplay} is {@code true}.
   *
   * @param playerPlugin the plugin to use for playback.
   * @param mediaURL the URL of the media to playback
   * @param autoplay {@code true} to start playing automatically, {@code false} otherwise
   * @param height the height of the player
   * @param width the width of the player.
   * @throws LoadException if an error occurs while loading the media.
   * @throws PluginVersionException if the required player plugin version is not installed on the
   *     client.
   * @throws PluginNotFoundException if the player plugin is not installed on the client.
   * @throws NullPointerException if {@code height} or {@code width} is {@code null}
   * @see Plugin
   * @see QuickTimePlayer
   * @see WinMediaPlayer
   * @see FlashMediaPlayer
   */
  public CustomVideoPlayer(
      Plugin playerPlugin, String mediaURL, boolean autoplay, String height, String width)
      throws PluginNotFoundException, PluginVersionException, LoadException {
    if (height == null) {
      throw new NullPointerException("height cannot be null");
    }
    if (width == null) {
      throw new NullPointerException("width cannot be null");
    }

    engine = PlayerUtil.getPlayer(playerPlugin, mediaURL, autoplay, height, "100%");
    engine.addDebugHandler(
        new DebugHandler() {

          @Override
          public void onDebug(DebugEvent event) {
            fireEvent(event);
          }
        });
    engine.addLoadingProgressHandler(
        new LoadingProgressHandler() {

          @Override
          public void onLoadingProgress(LoadingProgressEvent event) {
            fireEvent(event);
          }
        });
    engine.addMediaInfoHandler(
        new MediaInfoHandler() {

          @Override
          public void onMediaInfoAvailable(MediaInfoEvent event) {
            fireEvent(event);
          }
        });
    engine.addPlayStateHandler(
        new PlayStateHandler() {

          @Override
          public void onPlayStateChanged(PlayStateEvent event) {
            fireEvent(event);
          }
        });
    engine.addPlayerStateHandler(
        new PlayerStateHandler() {

          @Override
          public void onPlayerStateChanged(PlayerStateEvent event) {
            switch (event.getPlayerState()) {
              case DimensionChangedOnVideo:
                onVideoDimensionChanged(engine.getOffsetWidth(), engine.getOffsetHeight());
                break;
              default:
                fireEvent(event);
            }
          }
        });

    engine.setConfigParameter(ConfigParameter.WMPUIMode, WinMediaPlayer.UIMode.NONE);
    engine.setControllerVisible(false);
    engine.showLogger(false);

    controller = new SimplePanel();
    controller.setWidth("100%");

    FlowPanel hp = new FlowPanel();
    hp.add(engine);
    hp.add(controller);

    super.initWidget(hp);
    setWidth(width);
  }
Exemplo n.º 10
0
  private Widget createEmailPanel() {
    VerticalPanel mailPanel = new VerticalPanel();

    SimplePanel vSpacer = new SimplePanel();
    vSpacer.setHeight("15px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("smtpHost") + ":"));
    smtpHostTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            String text = smtpHostTextBox.getText();
            return (text != null && text.length() > 0);
          }
        };
    smtpHostTextBox.setValidationMessage(Messages.getString("smtpHostValidationMessage"));
    smtpHostTextBox.setWidth("400px");
    mailPanel.add(smtpHostTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("port") + ":"));
    portTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return isPortValid(portTextBox.getText());
          }
        };
    portTextBox.setValidationMessage(Messages.getString("portValidationMessage"));
    portTextBox.setWidth("400px");
    mailPanel.add(portTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("protocol") + ":"));
    protocolsListBox = new ListBox();
    protocolsListBox.addItem(Messages.getString("smtp"));
    protocolsListBox.addItem(Messages.getString("smtps"));
    mailPanel.add(protocolsListBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    useStartTLSCheckBox = new CheckBox(Messages.getString("useStartTLS"));
    mailPanel.add(useStartTLSCheckBox);

    useSSLCheckBox = new CheckBox(Messages.getString("useSSL"));
    mailPanel.add(useSSLCheckBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    mailPanel.add(new Label(Messages.getString("fromName") + ":"));
    fromNameTextBox = new TextBox();
    fromNameTextBox.setWidth("400px");
    mailPanel.add(fromNameTextBox);

    mailPanel.add(new Label(Messages.getString("defaultFromAddress") + ":"));
    HorizontalPanel hPanel = new HorizontalPanel();
    fromAddressTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return isValidEmail(fromAddressTextBox.getText());
          }
        };
    fromAddressTextBox.setValidationMessage(Messages.getString("fromAddressValidationMessage"));
    fromAddressTextBox.setWidth("400px");
    hPanel.add(fromAddressTextBox);
    SimplePanel hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    hPanel.add(hSpacer);
    Label emailOrginLabel = new Label(Messages.getString("emailOriginLabel"));
    emailOrginLabel.setStyleName("msg-Label");
    hPanel.add(emailOrginLabel);
    mailPanel.add(hPanel);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    mailPanel.add(vSpacer);

    authenticationCheckBox = new CheckBox(Messages.getString("useAuthentication"));
    mailPanel.add(authenticationCheckBox);

    authenticationPanel = new VerticalPanel();
    mailPanel.add(authenticationPanel);
    authenticationPanel.add(new Label(Messages.getString("userName") + ":"));
    userNameTextBox =
        new ValidationTextBox() {
          public boolean validate() {
            return !StringUtils.isEmpty(userNameTextBox.getText());
          }
        };
    userNameTextBox.setValidationMessage(Messages.getString("usernameValidationMessage"));
    userNameTextBox.setWidth("400px");
    authenticationPanel.add(userNameTextBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("10px");
    authenticationPanel.add(vSpacer);

    authenticationPanel.add(new Label(Messages.getString("password") + ":"));
    hPanel = new HorizontalPanel();
    passwordTextBox =
        new ValidationPasswordTextBox() {

          @Override
          public boolean validate() {
            return !StringUtils.isEmpty(passwordTextBox.getText());
          }
        };
    passwordTextBox.setValidationMessage(Messages.getString("passwordValidationMessage"));
    passwordTextBox.setWidth("319px");
    hPanel.add(passwordTextBox);

    hSpacer = new SimplePanel();
    hSpacer.setWidth("15px");
    hPanel.add(hSpacer);

    editPasswordButton = new Button(Messages.getString("edit") + "...");
    editPasswordButton.setStylePrimaryName("pentaho-button");
    hPanel.add(editPasswordButton);
    editPasswordButton.setEnabled(false);
    authenticationPanel.add(hPanel);

    debuggingCheckBox = new CheckBox(Messages.getString("enableDebugging"));
    mailPanel.add(debuggingCheckBox);

    vSpacer = new SimplePanel();
    vSpacer.setHeight("20px");
    mailPanel.add(vSpacer);

    HorizontalPanel buttonsPanel = new HorizontalPanel();
    mailPanel.add(buttonsPanel);

    hSpacer = new SimplePanel();
    hSpacer.setWidth("339px");
    buttonsPanel.add(hSpacer);

    testButton = new Button(Messages.getString("test"));
    testButton.setStylePrimaryName("pentaho-button");
    buttonsPanel.add(testButton);

    return mailPanel;
  }