/** * Creates a Heading with the passed in size and text. * * @param size size of the heading * @param text text for the heading */ public Heading(final HeadingSize size, final String text) { this(size); setText(text); }
private void createTitle(String titleString) { title = new Heading(HeadingSize.H3, titleString); }
/** * {@inheritDoc} */ @Override protected void onAttach() { super.onAttach(); // Adding styles to the heading depending on the parent if (getParent() != null) { if (getParent() instanceof LinkedGroupItem) { addStyleName(Styles.LIST_GROUP_ITEM_HEADING); } else if (getParent() instanceof PanelHeader) { addStyleName(Styles.PANEL_TITLE); } else if (getParent() instanceof MediaBody) { addStyleName(Styles.MEDIA_HEADING); } } } }
final Heading heading = new Heading(titleSize); heading.setText(title); heading.addStyleName(style.entityListTitle()); groupPanel.add(heading);
private void createLink(final SocialUser follower, final ParameterizedCommand<String> command) { username.setText(follower.getName()); if (command != null) { username.addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { command.execute(follower.getUserName()); } }, ClickEvent.getType()); username.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { username.getElement().getStyle().setCursor(Style.Cursor.POINTER); } }, MouseOverEvent.getType()); } }
public WorkItemDefinitionElementsBrowser() { final Heading label = new Heading( HeadingSize.H4, WorkItemsEditorConstants.INSTANCE.BrowserTitle() ); label.getElement().getStyle().setTextAlign( Style.TextAlign.CENTER ); label.addStyleName( ColumnSize.MD_12.getCssName() ); container.add( new Row() {{ add( label ); }} ); container.add( new Row() {{ add( elements ); }} ); //Images container.add( new Row() {{ add( imagesList ); }} ); imagesList.setVisibleItemCount( 1 ); imagesList.setSelectedIndex( 0 ); imagesList.addChangeHandler( new ChangeHandler() { public void onChange( ChangeEvent event ) { elementSelected( imagesList.getItemText( imagesList.getSelectedIndex() ), imagesList.getValue( imagesList.getSelectedIndex() ) ); } } ); initWidget( container ); }
public CalendarPicker() { currentDate = new Date(); viewType = ViewType.DAY; calendarPanel.addStyleName( ColumnSize.MD_2.getCssName() ); calendarPanel.addStyleName( ColumnOffset.MD_1.getCssName() ); calendarLabel = new Heading( HeadingSize.H4 ); iconLabel = new Heading( HeadingSize.H4 ); iconLabel.addStyleName( ColumnSize.MD_2.getCssName() ); iconPanel.add( iconLabel ); controlsLabel = new Heading( HeadingSize.H4 ); controlsPanel.add( controlsLabel ); calendarIcon = new Anchor(); previousButton = new Button(); nextButton = new Button(); todayButton = new Button(); initWidget( mainPanel ); }
private void setupRootGallery() { galleryRoot = new Div(); galleryRoot.getElement().setId("blueimp-gallery"); galleryRoot.getElement().setClassName("blueimp-gallery"); galleryRoot.getElement().setAttribute("data-use-bootstrap-modal", "false"); Div slides = new Div(); slides.getElement().setClassName("slides"); galleryRoot.add(slides); title = new Heading(HeadingSize.H3); title.getElement().setClassName("title"); galleryRoot.add(title); prev = new Anchor(""); prev.getElement().setClassName("prev"); prev.setIcon(IconType.CARET_LEFT); galleryRoot.add(prev); next = new Anchor(""); next.getElement().setClassName("next"); next.setIcon(IconType.CARET_RIGHT); galleryRoot.add(next); close = new Anchor(""); close.getElement().setClassName("close"); close.setIcon(IconType.CLOSE); galleryRoot.add(close); indicator = new OrderedList(); indicator.getElement().setClassName("indicator"); galleryRoot.add(indicator); }
static PanelHeader createPanelHeader(final PropertyEditorCategory category, final PanelGroup propertyMenu, PanelCollapse panelCollapse) { final Heading heading = new Heading(HeadingSize.H4); final Anchor anchor = GWT.create(Anchor.class); anchor.setText(category.getName()); anchor.setDataToggle(Toggle.COLLAPSE); anchor.setDataParent(propertyMenu.getId()); anchor.setDataTargetWidget(panelCollapse); anchor.addStyleName("collapsed"); heading.add(anchor); final PanelHeader header = GWT.create(PanelHeader.class); header.add(heading); return header; }
@Override public void onMouseOver(MouseOverEvent event) { username.getElement().getStyle().setCursor(Style.Cursor.POINTER); } },
private void setupCSS() { if (position == UberfireDockPosition.SOUTH) { titlePanel.addStyleName(CSS.CSS().dockExpandedContentPanelSouth()); title.addStyleName(CSS.CSS().dockExpandedLabelSouth()); collapse.addStyleName(CSS.CSS().dockExpandedButtonSouth()); collapse.setIcon(IconType.CHEVRON_DOWN); } else if (position == UberfireDockPosition.WEST) { title.addStyleName(CSS.CSS().dockExpandedLabelWest()); collapse.addStyleName(CSS.CSS().dockExpandedButtonWest()); collapse.setIcon(IconType.CHEVRON_LEFT); } else if (position == UberfireDockPosition.EAST) { title.addStyleName(CSS.CSS().dockExpandedLabelEast()); collapse.addStyleName(CSS.CSS().dockExpandedButtonEast()); collapse.setIcon(IconType.CHEVRON_RIGHT); } setupDockContentSize(); }
/** * Sets the subtext for the heading (wrapped in a Small tag). * <p/> * When using the setter for this, the subtext will be added after the text * * @param subText the subtext of the heading */ @Override public void setSubText(final String subText) { // Force a space between the heading and the subText this.subText.setText(" " + subText); add(this.subText); }
final Heading heading = new Heading(titleSize); heading.setText(title); heading.addStyleName(style.entityListTitle()); groupPanel.add(heading);
private void createLink(final SocialUser follower, final ParameterizedCommand<String> command) { username.setText(follower.getName()); if (command != null) { username.addDomHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { command.execute(follower.getUserName()); } }, ClickEvent.getType()); username.addDomHandler(new MouseOverHandler() { @Override public void onMouseOver(MouseOverEvent event) { username.getElement().getStyle().setCursor(Style.Cursor.POINTER); } }, MouseOverEvent.getType()); } }
public WorkItemDefinitionElementsBrowser() { final Heading label = new Heading( HeadingSize.H4, WorkItemsEditorConstants.INSTANCE.BrowserTitle() ); label.getElement().getStyle().setTextAlign( Style.TextAlign.CENTER ); label.addStyleName( ColumnSize.MD_12.getCssName() ); container.add( new Row() {{ add( label ); }} ); container.add( new Row() {{ add( elements ); }} ); //Images container.add( new Row() {{ add( imagesList ); }} ); imagesList.setVisibleItemCount( 1 ); imagesList.setSelectedIndex( 0 ); imagesList.addChangeHandler( new ChangeHandler() { public void onChange( ChangeEvent event ) { elementSelected( imagesList.getItemText( imagesList.getSelectedIndex() ), imagesList.getValue( imagesList.getSelectedIndex() ) ); } } ); initWidget( container ); }
private void setupRootGallery() { galleryRoot = new Div(); galleryRoot.getElement().setId("blueimp-gallery"); galleryRoot.getElement().setClassName("blueimp-gallery"); galleryRoot.getElement().setAttribute("data-use-bootstrap-modal", "false"); Div slides = new Div(); slides.getElement().setClassName("slides"); galleryRoot.add(slides); title = new Heading(HeadingSize.H3); title.getElement().setClassName("title"); galleryRoot.add(title); prev = new Anchor(""); prev.getElement().setClassName("prev"); prev.setIcon(IconType.CARET_LEFT); galleryRoot.add(prev); next = new Anchor(""); next.getElement().setClassName("next"); next.setIcon(IconType.CARET_RIGHT); galleryRoot.add(next); close = new Anchor(""); close.getElement().setClassName("close"); close.setIcon(IconType.CLOSE); galleryRoot.add(close); indicator = new OrderedList(); indicator.getElement().setClassName("indicator"); galleryRoot.add(indicator); }