Example usage for com.vaadin.ui Alignment TOP_LEFT

List of usage examples for com.vaadin.ui Alignment TOP_LEFT

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment TOP_LEFT.

Prototype

Alignment TOP_LEFT

To view the source code for com.vaadin.ui Alignment TOP_LEFT.

Click Source Link

Usage

From source file:edu.kit.dama.ui.simon.panel.SimonMainPanel.java

License:Apache License

/**
 * Build the overview tab including the list of all categories and der
 * overall status./* w w w .j  a  va  2s. c  o m*/
 *
 * @param pCategories A list of all categories.
 *
 * @return The tab component.
 */
private Component buildOverviewTab(String[] pCategories) {
    AbsoluteLayout abLay = new AbsoluteLayout();
    UIUtils7.GridLayoutBuilder layoutBuilder = new UIUtils7.GridLayoutBuilder(4, pCategories.length + 1);

    updateButton = new Button("Update Status");
    updateButton.addClickListener(this);
    Embedded logo = new Embedded(null, new ThemeResource("img/simon.png"));
    abLay.addComponent(logo, "top:30px;left:30px;");

    Label simonSaysLabel = new Label("", ContentMode.HTML);
    simonSaysLabel.setHeight("150px");
    setSimonSaysContent(simonSaysLabel, "Everything is fine.");
    abLay.addComponent(simonSaysLabel, "top:30px;left:250px;");

    int row = 0;
    for (String category : pCategories) {
        HorizontalLayout rowLayout = new HorizontalLayout();
        Label name = new Label(category);
        name.setWidth("200px");
        name.setHeight("24px");
        List<AbstractProbe> probes = probesByCategory.get(category);
        Collections.sort(probes, new Comparator<AbstractProbe>() {
            @Override
            public int compare(AbstractProbe o1, AbstractProbe o2) {
                return o1.getCurrentStatus().compareTo(o2.getCurrentStatus());
            }
        });

        int failed = 0;
        int unknown = 0;
        int unavailable = 0;
        int charactersPerProbe = 100;
        if (probes.size() > 0) {
            charactersPerProbe = (int) Math.rint((700.0 / probes.size()) / 8.0);
        }

        for (AbstractProbe probe : probes) {
            Label probeLabel = new Label(StringUtils.abbreviate(probe.getName(), charactersPerProbe));
            probeLabel.setHeight("24px");
            switch (probe.getCurrentStatus()) {
            case UNKNOWN:
                probeLabel.setDescription(probe.getName() + ": UNKNOWN");
                probeLabel.addStyleName("probe-unknown");
                unknown++;
                break;
            case UPDATING:
                probeLabel.setDescription(probe.getName() + ": UPDATING");
                probeLabel.addStyleName("probe-updating");
                break;
            case UNAVAILABLE:
                probeLabel.setDescription(probe.getName() + ": UNAVAILABLE");
                probeLabel.addStyleName("probe-unavailable");
                unavailable++;
                break;
            case FAILED:
                probeLabel.setDescription(probe.getName() + ": FAILED");
                probeLabel.addStyleName("probe-failed");
                failed++;
                break;
            default:
                probeLabel.setDescription(probe.getName() + ": SUCCESS");
                probeLabel.addStyleName("probe-success");
            }

            probeLabel.addStyleName("probe");
            rowLayout.addComponent(probeLabel);
        }

        if (failed != 0) {
            setSimonSaysContent(simonSaysLabel, "There are errors!");
        } else {
            if (unknown != 0) {
                setSimonSaysContent(simonSaysLabel, "There are unknown states. Please select 'Update Status'.");
            } else {
                if (unavailable != 0) {
                    setSimonSaysContent(simonSaysLabel,
                            "Some probes are unavailable. Please check their configuration.");
                }
            }
        }

        rowLayout.setWidth("700px");
        layoutBuilder.addComponent(name, Alignment.TOP_LEFT, 0, row, 1, 1).addComponent(rowLayout,
                Alignment.TOP_LEFT, 1, row, 3, 1);
        row++;
    }

    layoutBuilder.addComponent(updateButton, Alignment.BOTTOM_RIGHT, 3, row, 1, 1);

    GridLayout tabLayout = layoutBuilder.getLayout();
    tabLayout.setSpacing(true);
    tabLayout.setMargin(true);
    Panel p = new Panel();
    p.setContent(tabLayout);
    p.setWidth("1024px");
    p.setHeight("400px");
    abLay.addComponent(p, "top:160px;left:30px;");
    abLay.setSizeFull();
    return abLay;
}

From source file:edu.nps.moves.mmowgli.MmowgliOuterFrame.java

License:Open Source License

public void addMenuBarAndFouoRowTL(User me) {
    HorizontalLayout hlay = new MHorizontalLayout().withMargin(false).withSpacing(false).withFullHeight();
    addComponent(hlay);/*from   w  w w.ja  v a  2s  . c  om*/

    if (me.isGameMaster() || me.isAdministrator() || me.isDesigner()) {
        menubar = new AppMenuBar(me.isGameMaster(), me.isAdministrator(), me.isDesigner());
        hlay.addComponent(menubar);
        hlay.setExpandRatio(menubar, 0.5f);
        hlay.setComponentAlignment(menubar, Alignment.TOP_LEFT);
    } else {
        Label lab = new Label();
        hlay.addComponent(lab);
        hlay.setExpandRatio(lab, 0.5f);
    }
    hlay.addComponent(fouoButton = makeFouoButtonTL());

    Label lab = new Label();
    hlay.addComponent(lab);
    hlay.setExpandRatio(lab, 0.5f);
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionDashboardTabActionPlans.java

License:Open Source License

public void initGuiTL() {
    AbstractLayout leftLay = getLeftLayout();

    flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    leftLay.addComponent(flowLay); //, "top:0px;left:0px");
    flowLay.addStyleName("m-padding15");
    flowLay.setSpacing(true);//  w ww. ja v  a2 s . c  o  m

    Label titleLab = new Label("All Plans");
    flowLay.addComponent(titleLab);
    flowLay.setComponentAlignment(titleLab, Alignment.TOP_LEFT);
    titleLab.addStyleName("m-actionplan-mission-title-text");

    Label contentLab = new Label("The Action Plans tab displays a list of all action plans in the game.");
    flowLay.addComponent(contentLab);
    flowLay.setComponentAlignment(contentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    Button requestActionPlanButt = new IDButton("Action Plan Request", ACTIONPLANREQUESTCLICK);
    requestActionPlanButt.setStyleName(BaseTheme.BUTTON_LINK);
    requestActionPlanButt.setDescription("Open a page where you can submit a request to create an action plan");
    flowLay.addComponent(requestActionPlanButt);

    AbsoluteLayout rightLay = getRightLayout();
    flowLay = new VerticalLayout();
    rightLay.addComponent(flowLay, "top:0px;left:0px");
    flowLay.setSpacing(true);
    flowLay.setStyleName("m-actionplan-plan-rightside"); // set the style name so the css's below can use it (e.g.: .m-actionplan-plan-rightside
                                                         // .m-actionplan-plan-headling { blah:blah;} )

    loadTableTL();
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionDashboardTabMyPlans.java

License:Open Source License

public void initGuiTL() {
    AbstractLayout leftLay = getLeftLayout();

    flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    flowLay.addStyleName("m-padding15");
    leftLay.addComponent(flowLay); //, "top:0px;left:0px");
    flowLay.setSpacing(true);//from w  w w  . j  av  a 2 s .  com

    Label titleLab = new Label("My Plans");
    flowLay.addComponent(titleLab);
    flowLay.setComponentAlignment(titleLab, Alignment.TOP_LEFT);
    titleLab.addStyleName("m-actionplan-mission-title-text");

    Label contentLab = new Label("Choose a link below to display the filtered list of your choice.");
    flowLay.addComponent(contentLab);
    flowLay.setComponentAlignment(contentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    Label lab;
    flowLay.addComponent(lab = new Label());
    lab.setHeight("25px");

    Button myPlansButt = new Button("My Plans");
    //myPlansButt.setStyleName(BaseTheme.BUTTON_LINK);
    //flowLay.addComponent(myPlansButt);

    Button requestActionPlanButt = new IDButton("Request Action Plan Authorship", ACTIONPLANREQUESTCLICK);
    requestActionPlanButt.setStyleName(BaseTheme.BUTTON_LINK);
    requestActionPlanButt
            .setDescription("Open a page where you can submit a request to be an action plan author");
    flowLay.addComponent(requestActionPlanButt);

    // Note for the above button request
    flowLay.addComponent(new Label("(appears in another browser tab)"));

    ClickListener firstLis;
    myPlansButt.addClickListener(firstLis = new ButtListener2(buildMyPlansFilter(), null)); // @HibernateUserRead

    AbsoluteLayout rightLay = getRightLayout();

    flowLay = new VerticalLayout();
    rightLay.addComponent(flowLay, "top:0px;left:0px");
    flowLay.setSpacing(true);
    flowLay.setStyleName("m-actionplan-plan-rightside"); // set the style name so the css's below can use it (e.g.: .m-actionplan-plan-rightside
                                                         // .m-actionplan-plan-heading { blah:blah;} )

    firstLis.buttonClick(null); // loads the table
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionDashboardTabNeedAuthors.java

License:Open Source License

public void initGuiTL() {
    AbstractLayout leftLay = getLeftLayout();

    flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    flowLay.addStyleName("m-padding15");
    leftLay.addComponent(flowLay); //, "top:0px;left:0px");
    flowLay.setSpacing(true);/*from w w w  .  j a  v  a 2 s. c o  m*/

    Label titleLab = new Label("Action Plans needing Authors");
    flowLay.addComponent(titleLab);
    flowLay.setComponentAlignment(titleLab, Alignment.TOP_LEFT);
    titleLab.addStyleName("m-actionplan-mission-title-text");

    Label contentLab = new Label("You may sign up for authorship in any of these plans.");
    flowLay.addComponent(contentLab);
    flowLay.setComponentAlignment(contentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    Button requestActionPlanButt = new IDButton("Action Plan Request", ACTIONPLANREQUESTCLICK);
    requestActionPlanButt.setStyleName(BaseTheme.BUTTON_LINK);
    requestActionPlanButt
            .setDescription("Open a page where you can submit a request to be an action plan author");
    flowLay.addComponent(requestActionPlanButt);

    AbsoluteLayout rightLay = getRightLayout();

    flowLay = new VerticalLayout();
    rightLay.addComponent(flowLay, "top:0px;left:0px");
    flowLay.setSpacing(true);
    flowLay.setStyleName("m-actionplan-plan-rightside"); // set the style name so the css's below can use it (e.g.: .m-actionplan-plan-rightside
                                                         // .m-actionplan-plan-headling { blah:blah;} )

    loadTableTL();
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionPlanPageTabImages.java

License:Open Source License

@Override
public void initGui() {
    setSizeUndefined();// w  ww  .  ja va2s  . co  m
    VerticalLayout leftLay = getLeftLayout();
    leftLay.setSpacing(false);
    leftLay.setMargin(false);

    VerticalLayout flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    leftLay.addComponent(flowLay);
    flowLay.setSpacing(true);

    Label missionLab = new Label("Authors, add some images!");
    flowLay.addComponent(missionLab);
    flowLay.setComponentAlignment(missionLab, Alignment.TOP_LEFT);
    missionLab.addStyleName("m-actionplan-mission-title-text");

    ActionPlan ap = ActionPlan.getTL(apId);

    Label missionContentLab;
    if (!isMockup)
        missionContentLab = new HtmlLabel(ap.getImagesInstructions());
    else {
        Game g = Game.getTL();
        missionContentLab = new HtmlLabel(g.getDefaultActionPlanImagesText());
    }
    flowLay.addComponent(missionContentLab);
    flowLay.setComponentAlignment(missionContentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    MmowgliSessionGlobals globs = Mmowgli2UI.getGlobals();
    flowLay.addComponent(addImageButt);
    addImageButt.addStyleName("m-actionplan-addimage-butt");
    addImageButt.addStyleName("borderless");
    addImageButt.setIcon(globs.getMediaLocator().getActionPlanAddImageButt());
    addImageButt.addClickListener(new ImageAdder());
    addImageButt.setEnabled(!isReadOnly);

    flowLay.addComponent(nonAuthorLabel = new Label("Authors may add images when editing the plan."));
    nonAuthorLabel.setVisible(false);

    VerticalLayout rightLay = getRightLayout();
    rightLay.setSpacing(false);
    rightLay.setMargin(false);

    imageScroller = new Panel();
    GridLayout gridL = new GridLayout();
    gridL.setColumns(2);
    gridL.setSpacing(true);
    gridL.setMargin(new MarginInfo(true));
    imageScroller.setContent(gridL);
    imageScroller.setStyleName(Reindeer.PANEL_LIGHT); // make a transparent scroller
    imageScroller.setWidth("100%");
    imageScroller.setHeight("99%");
    setUpIndexListener(imageScroller);

    rightLay.addComponent(imageScroller);
    fillWithImagesTL();
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionPlanPageTabMap.java

License:Open Source License

@Override
public void initGui() {
    setSizeUndefined();/* w  w w  .j  a va 2  s .  c o m*/

    ActionPlan ap = ActionPlan.getTL(apId);
    mmowgliMap = ap.getMap();
    if (mmowgliMap == null) {
        mmowgliMap = new edu.nps.moves.mmowgli.db.GoogleMap();
        GoogleMap.saveTL(mmowgliMap);

        ap.setMap(mmowgliMap);
        ActionPlan.updateTL(ap);
    }

    VerticalLayout leftLay = getLeftLayout();
    leftLay.setSpacing(false);
    leftLay.setMargin(false);

    Label missionLab = new Label("Authors, put your plan on the map!");
    leftLay.addComponent(missionLab);
    leftLay.setComponentAlignment(missionLab, Alignment.TOP_LEFT);
    missionLab.addStyleName("m-actionplan-mission-title-text");

    Label missionContentLab;
    if (!isMockup)
        missionContentLab = new HtmlLabel(ap.getMapInstructions());
    else {
        Game g = Game.getTL();
        missionContentLab = new HtmlLabel(g.getDefaultActionPlanMapText());
    }

    leftLay.addComponent(missionContentLab);
    leftLay.setComponentAlignment(missionContentLab, Alignment.TOP_LEFT);
    leftLay.addStyleName("m-actionplan-mission-content-text");
    /*
    Component c;
    c=buildMapFlags(leftLay);  // does the addComponent
    leftLay.setComponentAlignment(c, Alignment.TOP_CENTER);
    */
    toggleFlags(editingOK);

    Label sp;
    leftLay.addComponent(sp = new Label());
    sp.setHeight("1px");
    leftLay.setExpandRatio(sp, 1.0f);

    map.setAttributionPrefix("Powered by Leaflet with v-leaflet");
    map.addStyleName("m-greyborder");
    map.removeAllComponents();
    try {
        LeafletLayers.installAllProviders(map);
    } catch (Exception ex) {
        System.err.println("ActionPlanPageTabMap error loading layers: " + ex.getClass().getSimpleName() + " "
                + ex.getLocalizedMessage());
    }
    double lat = mmowgliMap.getLatCenter();
    double lon = mmowgliMap.getLonCenter();
    map.setCenter(lat, lon);
    map.setZoomLevel(mmowgliMap.getZoom());
    map.setWidth(MAPWIDTH);
    map.setHeight(editingOK ? MAPHEIGHT_WITH_BUTTONS : MAPHEIGHT);

    // Build a mmowgliMap widget from our content
    /*
    googleMapWidget = new MmowgliMapWidget(app, mmowgliMap.getLatLonCenter(), mmowgliMap.getZoom(), GOOGLEMAPS_KEY);
            
    googleMapWidget.setWidth(MAPWIDTH);
    googleMapWidget.setHeight(editingOK ? MAPHEIGHT_WITH_BUTTONS : MAPHEIGHT);
    googleMapWidget.addControl(MapControl.MenuMapTypeControl);
    googleMapWidget.addControl(MapControl.SmallMapControl);
    //googleMapWidget.addListener(new MyMapClickListener());
    googleMapWidget.addListener(new MyMapMoveListener());
    //googleMapWidget.addListener(new MyMarkerClickListener());
    googleMapWidget.addListener(new MyMarkerMovedListener());
    googleMapWidget.reportMapBounds();
    */
    loadMarkers(ap);

    VerticalLayout rightLay = getRightLayout();
    rightLay.setSpacing(false);
    rightLay.setMargin(false);

    rightLay.addComponent(sp = new Label());
    sp.setHeight("15px");

    savePanel = new MapSaveButtPan();
    rightLay.addComponent(savePanel);
    rightLay.setComponentAlignment(savePanel, Alignment.TOP_CENTER);
    savePanel.setVisible(editingOK);
    // MapSaveListener msLis = new MapSaveListener();
    //  savePanel.setClickHearers(msLis.mapLocListener,msLis.mapMarkerListener,msLis.cancelListener);

    /*  DragAndDropWrapper ddw = new DragAndDropWrapper(googleMapWidget);
      ddw.setDropHandler(new MapDropHandler());
      ddw.setSizeFull();
              
      rightLay.addComponent(ddw);
      rightLay.setExpandRatio(ddw, 1.0f);
      */
    rightLay.addComponent(map);
    rightLay.setExpandRatio(map, 1);
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionPlanPageTabTalk.java

License:Open Source License

@Override
public void initGui() {
    setSizeUndefined();/* www .  ja v a 2 s.  c  o m*/
    VerticalLayout leftVL = this.getLeftLayout();

    leftVL.setSpacing(true);

    Label missionLab = new Label("Authors, this is your team space.");
    leftVL.addComponent(missionLab);
    leftVL.setComponentAlignment(missionLab, Alignment.TOP_LEFT);
    missionLab.addStyleName("m-actionplan-mission-title-text");

    ActionPlan ap = ActionPlan.getTL(apId);

    Label missionContentLab;
    Game g = Game.getTL();
    if (!isMockup)
        missionContentLab = new HtmlLabel(ap.getTalkItOverInstructions());
    else {
        missionContentLab = new HtmlLabel(g.getDefaultActionPlanTalkText());
    }

    leftVL.addComponent(missionContentLab);
    leftVL.setComponentAlignment(missionContentLab, Alignment.TOP_LEFT);
    leftVL.addStyleName("m-actionplan-mission-content-text");

    Label sp;
    leftVL.addComponent(sp = new Label());
    sp.setHeight("1px");
    leftVL.setExpandRatio(sp, 1.0f);

    VerticalLayout rightVL = getRightLayout();
    rightVL.setSpacing(true);

    Label lab;
    rightVL.addComponent(lab = new Label());
    lab.setHeight("15px");

    rightVL.addComponent(nonAuthorLabel = new Label("This is a space for plan authors to communicate."));
    nonAuthorLabel.setVisible(false);

    rightVL.addComponent(chatEntryComponent);
    chatEntryComponent.setWidth("100%");

    if (isGameMasterOrAdmin) {
        HorizontalLayout hl = new HorizontalLayout();
        rightVL.addComponent(hl);
        hl.setWidth("100%");

        hl.addComponent(sp = new Label());
        sp.setWidth("1px");
        hl.setExpandRatio(sp, 1.0f);

        viewAllButt = new ToggleLinkButton("View all", "View unhidden only", "m-actionplan-comment-text");
        viewAllButt.setToolTips("Temporarily show all messages, including those marked \"hidden\" (gm)",
                "Temporarily hide messages marked \"hidden\" (gm)");
        viewAllButt.addStyleName("m-actionplan-comments-button");
        viewAllButt.addOnListener(new ViewAllListener());
        viewAllButt.addOffListener(new ViewUnhiddenOnlyListener());
        hl.addComponent(viewAllButt);

        hl.addComponent(sp = new Label());
        sp.setWidth("8px");
    }
    Component comp = createChatScroller(rightVL);
    comp.setWidth("99%");
    rightVL.setExpandRatio(comp, 1.0f);
    comp.setHeight("99%");
    fillChatScrollerTL();
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionPlanPageTabThePlan2.java

License:Open Source License

@Override
public void initGui() {
    setSizeUndefined(); // let flow to right
    VerticalLayout leftLay = getLeftLayout();

    leftLay.setSpacing(false);/*ww w .  j  av a  2 s  .  co m*/
    leftLay.setMargin(false);

    VerticalLayout flowLay = new VerticalLayout();
    leftLay.addComponent(flowLay);
    flowLay.setSpacing(true);

    Label missionLab = new Label("Authors, this is your workspace.");
    flowLay.addComponent(missionLab);
    flowLay.setComponentAlignment(missionLab, Alignment.TOP_LEFT);
    missionLab.addStyleName("m-actionplan-mission-title-text");

    ActionPlan actPln = ActionPlan.getTL(apId);
    Label missionContentLab;
    if (!isMockup)
        missionContentLab = new HtmlLabel(actPln.getPlanInstructions());
    else {
        Game g = Game.getTL();
        missionContentLab = new HtmlLabel(g.getDefaultActionPlanThePlanText());
    }
    MovePhase ph = MovePhase.getCurrentMovePhaseTL();

    flowLay.addComponent(missionContentLab);
    flowLay.setComponentAlignment(missionContentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    VerticalLayout rightLay = getRightLayout();
    rightLay.setMargin(false);
    rightLay.setSpacing(false);

    flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    rightLay.addComponent(flowLay);
    flowLay.setSpacing(true);
    flowLay.setStyleName("m-actionplan-plan-rightside"); // set the style name so the css's below can use it (e.g.: .m-actionplan-plan-rightside .m-actionplan-plan-headling { blah:blah;} )

    Label lab = new Label();
    lab.setHeight("20px");
    flowLay.addComponent(lab);

    flowLay.addComponent(whoGroup = buildTextAreaGroup(
            ph.getActionPlanWhoIsInvolvedHeader()/*"Who is involved?"*/, whoTA, "Who-is-involved history",
            "Previous values", "Text", "getSubTitleEditHistory", "getSubTitle", "setSubTitleWithHistoryTL"));
    whoGroup.setValueTL(actPln.getSubTitle()); // misnamed since we're calling it it who is involved instead of subtitle

    flowLay.addComponent(whatGroup = buildTextAreaGroup(ph.getActionPlanWhatIsItHeader()/*"What is it?"*/,
            whatTA, "What-is-it history", "Previous values", "Text", "getWhatIsItEditHistory",
            "getWhatIsItText", "setWhatIsItTextWithHistoryTL"));
    whatGroup.setValueTL(actPln.getWhatIsItText());

    flowLay.addComponent(
            whatTakeGroup = buildTextAreaGroup(ph.getActionPlanWhatWillItTakeHeader()/*"What will it take?"*/,
                    whatWillItTakeTA, "What-will-it-take history", "Previous values", "Text",
                    "getWhatTakeEditHistory", "getWhatWillItTakeText", "setWhatWillItTakeTextWithHistoryTL"));
    whatTakeGroup.setValueTL(actPln.getWhatWillItTakeText());

    flowLay.addComponent(
            howGroup = buildTextAreaGroup(ph.getActionPlanHowWillItWorkHeader()/*"How will it work?"*/,
                    howWorkTA, "How-will-it-work history", "Previous values", "Text", "getHowWorkEditHistory",
                    "getHowWillItWorkText", "setHowWillItWorkTextWithHistoryTL"));
    howGroup.setValueTL(actPln.getHowWillItWorkText());

    flowLay.addComponent(howChangeGroup = buildTextAreaGroup(
            ph.getActionPlanHowWillItChangeHeader()/*"How will it change the situation?"*/, howChangeTA,
            "How-will-it-change-things history", "Previous values", "Text", "getHowChangeEditHistory",
            "getHowWillItChangeText", "setHowWillItChangeTextWithHistoryTL"));
    howChangeGroup.setValueTL(actPln.getHowWillItChangeText());
}

From source file:edu.nps.moves.mmowgli.modules.actionplans.ActionPlanPageTabVideos.java

License:Open Source License

@Override
public void initGui() {
    setSizeUndefined();/*from  w w w .j  ava2 s  .  c  om*/
    VerticalLayout leftLay = getLeftLayout();
    leftLay.setSpacing(false);
    leftLay.setMargin(false);

    VerticalLayout flowLay = new VerticalLayout();
    flowLay.setWidth("100%");
    leftLay.addComponent(flowLay);
    flowLay.setSpacing(true);

    Label missionLab = new Label("Authors, add some videos!");
    flowLay.addComponent(missionLab);
    flowLay.setComponentAlignment(missionLab, Alignment.TOP_LEFT);
    missionLab.addStyleName("m-actionplan-mission-title-text");

    ActionPlan ap = ActionPlan.getTL(apId);

    Label missionContentLab;
    if (!isMockup)
        missionContentLab = new HtmlLabel(ap.getVideosInstructions());
    else {
        Game g = Game.getTL();
        missionContentLab = new HtmlLabel(g.getDefaultActionPlanVideosText());
    }
    flowLay.addComponent(missionContentLab);
    flowLay.setComponentAlignment(missionContentLab, Alignment.TOP_LEFT);
    flowLay.addStyleName("m-actionplan-mission-content-text");

    MmowgliSessionGlobals globs = Mmowgli2UI.getGlobals();
    flowLay.addComponent(addVideoButt);
    addVideoButt.addStyleName("m-actionplan-addimage-butt");
    addVideoButt.addStyleName("borderless");
    addVideoButt.setIcon(globs.getMediaLocator().getActionPlanAddVideoButt());
    addVideoButt.addClickListener(new VideoAdder());
    addVideoButt.setEnabled(!isReadOnly);

    flowLay.addComponent(nonAuthorLabel = new Label("Authors may add videos when editing the plan."));
    nonAuthorLabel.setVisible(false);

    VerticalLayout rightLay = getRightLayout();
    rightLay.setSpacing(false);
    rightLay.setMargin(false);

    rightScroller = new Panel();
    GridLayout gridL = new GridLayout();
    gridL.setColumns(2);
    gridL.setSpacing(true);
    gridL.setMargin(new MarginInfo(true));
    rightScroller.setContent(gridL);
    rightScroller.setStyleName(Reindeer.PANEL_LIGHT); // make a transparent scroller
    rightScroller.setWidth("100%");
    rightScroller.setHeight("99%");
    setUpIndexListener(rightScroller);

    rightLay.addComponent(rightScroller);
    ;
    fillWithVideosTL();
}