List of usage examples for com.vaadin.ui Button addStyleName
@Override public void addStyleName(String style)
From source file:dhbw.ka.mwi.businesshorizon2.ui.process.navigation.NavigationViewImpl.java
License:Open Source License
private void addLogoutButton(String text) { Button logoutButton = new Button(text); logoutButton.addStyleName("default"); logoutButton.setVisible(true);//from ww w . j a v a 2 s . c o m logoutButton.addListener(new Button.ClickListener() { private static final long serialVersionUID = 7411091035775152765L; @Override public void buttonClick(ClickEvent event) { //Callback-Methode, ruft die eigentliche Logout-Methode im Presenter auf presenter.doLogout(); } }); logoutButton.setEnabled(true); this.layout.addComponent(logoutButton); this.layout.setComponentAlignment(logoutButton, Alignment.TOP_RIGHT); }
From source file:edu.nps.moves.mmowgli.modules.administration.NewMovePhaseDialog.java
License:Open Source License
private void fillExistingPhases() { existingPhasesGLay.removeAllComponents(); List<MovePhase> lis = moveBeingEdited.getMovePhases(); int i = 1;/* ww w . ja va 2 s.c om*/ for (MovePhase mp : lis) { existingPhasesGLay.addComponent(new Label("" + i++)); existingPhasesGLay.addComponent(new Label(mp.getDescription())); Button butt; existingPhasesGLay.addComponent(butt = new PhaseDeleteButt(mp)); butt.addStyleName(Reindeer.BUTTON_SMALL); } }
From source file:edu.nps.moves.mmowgli.modules.administration.SubCardsGameDesignPanel.java
License:Open Source License
private Component renderFields(CardTypeFields fields, NativeSelect combo, String name) { VerticalLayout topPan = new VerticalLayout(); topPan.setWidth("98%"); topPan.addStyleName("m-greyborder3"); Label lab;/*from w w w . j av a 2 s . co m*/ topPan.addComponent(lab = new Label()); lab.setHeight("18px"); HorizontalLayout topHL = new HorizontalLayout(); topHL.setSpacing(true); ; topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.addComponent(lab = new HtmlLabel("<b>" + name + "</b>")); lab.setSizeUndefined(); topHL.addComponent(combo); Button newTypeButt; topHL.addComponent(newTypeButt = new NativeButton("Define new type")); newTypeButt.addStyleName(Runo.BUTTON_SMALL); newTypeButt.setReadOnly(globs.readOnlyCheck(false)); newTypeButt.setEnabled(!newTypeButt.isReadOnly()); if (!newTypeButt.isReadOnly()) newTypeButt.addClickListener(new NewTypeListener(fields.typeOrdinal)); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topPan.addComponent(topHL); topHL.setWidth("100%"); topPan.addComponent(fields); fields.setWidth("100%"); return topPan; }
From source file:edu.nps.moves.mmowgli.modules.administration.TopCardsGameDesignPanel.java
License:Open Source License
private Component renderFields(CardTypeFields fields, NativeSelect combo, String name, Label editWarningLab) { VerticalLayout topPan = new VerticalLayout(); topPan.setWidth("98%"); topPan.addStyleName("m-greyborder3"); Label lab;/*from ww w . j a va 2 s . c o m*/ topPan.addComponent(lab = new Label()); lab.setHeight("18px"); HorizontalLayout topHL = new HorizontalLayout(); topHL.setSpacing(true); ; topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topHL.addComponent(lab = new HtmlLabel("<b>" + name + "</b>")); lab.setSizeUndefined(); topHL.addComponent(combo); Button newTypeButt; topHL.addComponent(newTypeButt = new NativeButton("Define new top-level type")); newTypeButt.addStyleName(Runo.BUTTON_SMALL); newTypeButt.setReadOnly(globals.readOnlyCheck(false)); newTypeButt.setEnabled(!newTypeButt.isReadOnly()); if (!newTypeButt.isReadOnly()) newTypeButt.addClickListener(new NewCardClassListener(fields.cardClass)); topHL.addComponent(lab = new Label()); lab.setWidth("1px"); topHL.setExpandRatio(lab, 0.5f); topPan.addComponent(topHL); topHL.setWidth("100%"); addComponent(editWarningLab); topPan.addComponent(fields); fields.setWidth("100%"); return topPan; }
From source file:edu.nps.moves.mmowgli.modules.administration.VideoChangerComponent.java
License:Open Source License
VideoChangerComponent(MovePhase mp, String setterMethodName, Media m, GameDesignGlobals globs) { this.mp = mp; this.currentMedia = m; try {//from www.jav a2 s . c om movePhaseSetter = MovePhase.class.getDeclaredMethod(setterMethodName, new Class<?>[] { Media.class }); } catch (Exception e) { throw new RuntimeException(e); } setSpacing(true); setMargin(false); setSizeUndefined(); addComponent(roTF = new TextField()); roTF.addStyleName("m-textarea-greyborder"); //tf.setColumns(20); roTF.setValue(currentMedia == null ? "" : currentMedia.getUrl()); roTF.setReadOnly(true); Button butt; addComponent(butt = new Button("change", this)); setComponentAlignment(butt, Alignment.MIDDLE_CENTER); butt.addStyleName(Reindeer.BUTTON_SMALL); butt.setReadOnly(globs.readOnlyCheck(false)); butt.setEnabled(!butt.isReadOnly()); }
From source file:edu.nps.moves.mmowgli.modules.cards.IdeaDashboardTabRecent.java
License:Open Source License
private Button buildButt(String s) { Button b = new NativeButton(s); b.setStyleName(BaseTheme.BUTTON_LINK); b.addStyleName("borderless"); b.addStyleName("m-actionplan-comments-button"); b.addClickListener(this); return b;/*w ww. j a v a 2s .c o m*/ }
From source file:edu.nps.moves.mmowgli.utility.MediaLocator.java
License:Open Source License
public void decorateDialogContinueButton(Button butt) { butt.setIcon(locate(new Media("continue.png", "", "", MediaType.IMAGE, Source.GAME_IMAGES_REPOSITORY))); butt.addStyleName("borderless"); }
From source file:edu.nps.moves.mmowgli.utility.MediaLocator.java
License:Open Source License
public void decorateImageButton(Button butt, String imageName) { butt.setIcon(locate(new Media(imageName, "", "", MediaType.IMAGE, Source.GAME_IMAGES_REPOSITORY))); butt.addStyleName("borderless"); }
From source file:edu.nps.moves.mmowgli.utility.MediaLocator.java
License:Open Source License
public void decorateGetABriefingButton(Button butt) { butt.setIcon(locate(/* w w w .j av a 2 s . c om*/ new Media("getABriefing129w24h.png", "", "", MediaType.IMAGE, Source.GAME_IMAGES_REPOSITORY))); butt.addStyleName("borderless"); }
From source file:edu.nps.moves.mmowgli.utility.MediaLocator.java
License:Open Source License
public void decorateCancelButton(Button butt) { butt.setIcon(getCancelButtonIcon()); butt.addStyleName("borderless"); }