コード例 #1
0
 public void add(
     final Widget child,
     ImageResource icon,
     String docId,
     final String text,
     String tooltip,
     Integer position) {
   if (closeableTabs_) {
     DocTab tab =
         new DocTab(
             icon,
             docId,
             text,
             tooltip,
             new TabCloseObserver() {
               public void onTabClose() {
                 int index = getWidgetIndex(child);
                 if (index >= 0) {
                   tryCloseTab(index, null);
                 }
               }
             });
     docTabs_.add(tab);
     if (position == null || position < 0) super.add(child, tab);
     else super.insert(child, tab, position);
   } else {
     if (position == null || position < 0) super.add(child, text);
     else super.insert(child, text, position);
   }
 }
コード例 #2
0
  private TelaInicialTopicoProfessor(MainView mainView) {

    this.mainView = mainView;

    TextConstants txtConstants = GWT.create(TextConstants.class);

    adicionarTopicoProfessor = new AdicionarTopicoProfessor(this);
    editarTopicoProfessor = new EditarTopicoProfessor(this);

    TabLayoutPanel tabLayoutPanel = new TabLayoutPanel(2.5, Unit.EM);
    //		stackPanel.setPixelSize(intWidthTable + 50, intHeightTable);
    tabLayoutPanel.setHeight(Integer.toString(intHeightTable) + "px");
    tabLayoutPanel.setAnimationDuration(500);
    tabLayoutPanel.setAnimationVertical(true);

    tabLayoutPanel.add(
        adicionarTopicoProfessor,
        new MpHeaderWidget(txtConstants.topicoAdicionar(), "images/plus-circle.png"));
    tabLayoutPanel.add(
        editarTopicoProfessor,
        new MpHeaderWidget(txtConstants.topicoEditar(), "images/comment_edit.png"));

    //		VerticalPanel verticalPanelPage = new VerticalPanel();
    //		verticalPanelPage.add(stackPanel);
    //		verticalPanelPage.add(new InlineHTML("&nbsp;"));

    initWidget(tabLayoutPanel);
  }
コード例 #3
0
 public MainAgenteLayout() {
   setStylePrimaryName(MaliceResources.INSTANCE.main().agenteLayout());
   add(toolbarsContainerPanel);
   add(maliceDisplayContainer);
   // MALICEDISPLAYCONTAINER
   maliceDisplayContainer.setAnimationDuration(0); // in millisec
   maliceDisplayContainer.add(benvenutoScrollPanel);
   maliceDisplayContainer.add(titoliScrollPanel);
   maliceDisplayContainer.add(incassiScrollPanel);
   maliceDisplayContainer.add(chiusureScrollPanel);
   maliceDisplayContainer.add(statisticheScrollPanel);
   maliceDisplayContainer.selectTab(BENVENUTO_TAB);
   setVisible(false);
 }
コード例 #4
0
  /**
   * Add a new tab with the provided name and content.
   *
   * <p>Wrapper function for {@link com.google.gwt.user.client.ui.TabLayoutPanel#add(Widget,
   * String)}
   *
   * @param tabContent the widget to add as a tab
   * @param tabName the name of the tab to display in the tabbar
   */
  public void add(E tabContent, String tabName) {

    tabContent.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
    m_tabPanel.add(tabContent, tabName);

    Element tabRootEl = m_tabPanel.getElement();
    // set an additional css class for the parent element of the .gwt-TabLayoutPanelTabs element
    List<Element> tabDivs =
        CmsDomUtil.getElementsByClass(
            I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cmsTabLayoutPanelTab(),
            CmsDomUtil.Tag.div,
            tabRootEl);

    Iterator<Element> it = tabDivs.iterator();
    boolean first = true;
    while (it.hasNext()) {

      Element e = it.next();
      e.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerLeft());
      e.removeClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerRight());
      if (first) {
        e.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerLeft());
        first = false;
      }
      if (!it.hasNext()) {
        e.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().cornerRight());
      }
    }
  }
コード例 #5
0
  /**
   * Add a new tab with the provided name and content and additional left margin.
   *
   * <p>
   *
   * @param tabContent the widget to add as a tab
   * @param tabName the name of the tab to display in the tabbar
   */
  public void addWithLeftMargin(E tabContent, String tabName) {

    tabContent.addStyleName(I_CmsLayoutBundle.INSTANCE.generalCss().cornerAll());
    m_tabPanel.add(tabContent, tabName);

    int tabIndex = m_tabPanel.getWidgetIndex(tabContent);
    Element tabElement = getTabElement(tabIndex);
    if (tabElement != null) {
      tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().tabLeftMargin());
      if (!m_panelStyle.equals(CmsTabbedPanelStyle.classicTabs)) {
        tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.generalCss().buttonCornerAll());
        tabElement.addClassName(I_CmsLayoutBundle.INSTANCE.tabbedPanelCss().borderAll());
      }
    }
  }
コード例 #6
0
  private void initialize() {

    HorizontalPanel controler = new HorizontalPanel();

    this.addNorth(controler, 30);

    Button okBt =
        new Button(
            "OK",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                updateSettings();
                closePanel();
              }
            });
    controler.add(okBt);

    Button cancelBt =
        new Button(
            "Cancel",
            new ClickHandler() {
              @Override
              public void onClick(ClickEvent event) {
                doCancel();
              }
            });
    controler.add(cancelBt);

    // main
    TabLayoutPanel tab = new TabLayoutPanel(25, Unit.PX);
    // tab.setSize("100%","100%");
    this.add(tab);

    ScrollPanel scroll = new ScrollPanel();
    // scroll.setSize("100%","100%");
    // creaate gif-anime panel
    // tab.add(scroll,"GifAnime");//stop support gif-anime
    scroll.add(createGifPanel());

    ScrollPanel scroll2 = new ScrollPanel();
    // scroll.setSize("100%","100%");
    // creaate gif-anime panel
    tab.add(scroll2, "Screenshot");
    scroll2.add(createScreenshotPanel());
  }
コード例 #7
0
ファイル: HQMFViewer.java プロジェクト: chinbaj/CQL_POC
  public void onModuleLoad() {

    TabLayoutPanel tabLayoutPanel = new TabLayoutPanel(2.5, Unit.EM);
    final SplitLayoutPanel splitLayoutPanel = new SplitLayoutPanel();
    final HorizontalPanel hPanel = new HorizontalPanel();
    hPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
    hPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    hPanel.setSpacing(10);
    hPanel.add(new HTML("HQMF Viewer."));
    Button processHQMFButton = new Button("Process HQMF.");
    processHQMFButton.addStyleName("sendButton");
    hPanel.add(processHQMFButton);
    hPanel.add(new HTML("\t(For some reason, works only in IE right now.)"));

    final VerticalPanel summaryVerticalPanel = new VerticalPanel();
    summaryVerticalPanel.setSpacing(3);
    processHQMFButton.setStyleName("summaryVPanel");
    summaryVerticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    summaryVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    splitLayoutPanel.addNorth(hPanel, 50);
    splitLayoutPanel.addWest(summaryVerticalPanel, 0);

    final RichTextArea textArea = new RichTextArea();
    textArea.setTitle("Paste your HQMF XML here.");
    textArea.setText("Paste your HQMF XML here.");
    textArea.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            if (textArea.getText().length() < 30
                && textArea.getText().equals("Paste your HQMF XML here.")) {
              textArea.setText("");
            }
          }
        });
    textArea.addStyleName("boxsizingBorder");
    textArea.setWidth("100%");
    textArea.setHeight("100%");

    processHQMFButton.addClickHandler(
        new ClickHandler() {

          @Override
          public void onClick(ClickEvent event) {
            processHQMF(textArea, splitLayoutPanel, summaryVerticalPanel);
            splitLayoutPanel.remove(hPanel);
            splitLayoutPanel.setWidgetSize(summaryVerticalPanel, 200);
            splitLayoutPanel.setWidgetToggleDisplayAllowed(summaryVerticalPanel, true);
          }
        });
    splitLayoutPanel.add(textArea);

    MySplitLayoutPanel mySplitPanel = new MySplitLayoutPanel();
    final VerticalPanel testVerticalPanel = new VerticalPanel();
    testVerticalPanel.setSpacing(3);

    testVerticalPanel.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
    testVerticalPanel.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);

    // final RichTextArea testtextArea = getSmartTextArea();
    // final AceEditor testtextArea = getAceEditor();
    AceEditor aceTxtArea = new AceEditor();
    aceTxtArea.setWidth("100%");
    aceTxtArea.setHeight("100%");

    mySplitPanel.addEast(testVerticalPanel, 0);
    mySplitPanel.add(aceTxtArea);
    //		mySplitPanel.add(testtextArea);

    aceTxtArea.startEditor();

    setAceEditorProperties(aceTxtArea);

    mySplitPanel.setWidgetToggleDisplayAllowed(testVerticalPanel, true);

    tabLayoutPanel.add(mySplitPanel, "test CQL Editor.");
    tabLayoutPanel.add(splitLayoutPanel, "HQMF Viewer");

    RootLayoutPanel.get().add(tabLayoutPanel);
  }