Example usage for org.apache.wicket.markup.html.link PopupSettings setWindowName

List of usage examples for org.apache.wicket.markup.html.link PopupSettings setWindowName

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.link PopupSettings setWindowName.

Prototype

public PopupSettings setWindowName(String popupWindowName) 

Source Link

Document

Sets the window name.

Usage

From source file:com.marintek.isis.wicket.ui.components.scalars.wicket.StandaloneValueAsPopupWicketBox.java

License:Apache License

private void buildGui() {
    PopupWicketBox fb;/*www .j  ava 2 s.c om*/
    IModel fbModel;

    final ValueModel model = getModel();
    final ObjectAdapter boxAdapter = model.getObject();
    final Object boxObj = boxAdapter.getObject();
    PopupWicketBox box = (PopupWicketBox) boxObj;

    // Add that link as a popup
    PopupSettings popupSettings = new PopupSettings(PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS);
    popupSettings.setHeight(box.getHeight());
    popupSettings.setWidth(box.getWidth());
    popupSettings.setLeft(box.getLeft());
    popupSettings.setTop(box.getTop());
    popupSettings.setWindowName(box.getTitle());

    ExternalLink link = new ExternalLink("popupbox", box.getUrl(), "Pop Up").setPopupSettings(popupSettings);
    addOrReplace(link);
}

From source file:org.efaps.ui.wicket.components.menu.PopupItem.java

License:Apache License

/**
 * @param _wicketId Wicket id for this component
 * @param _model    model for this component
 */// w ww. j  a  v a 2 s.  com
public PopupItem(final String _wicketId, final IModel<UIMenuItem> _model) {
    super(_wicketId, _model);
    final PopupSettings popupsetting = new PopupSettings();
    popupsetting.setHeight(_model.getObject().getWindowHeight());
    popupsetting.setWidth(_model.getObject().getWindowWidth());
    popupsetting.setWindowName("eFapsPopup");
    setPopupSettings(popupsetting);
}

From source file:org.sakaiproject.scorm.ui.console.pages.DisplayDesignatedPackage.java

License:Educational Community License

/**
 * @param pkg// w w w  .  j  a  v  a2  s .  c  o m
 */
@SuppressWarnings("deprecation")
protected void addActionLinksForPackage(final ContentPackage pkg) {

    PlayerPage playerPage = new PlayerPage(getParametersForPackage(pkg));
    Link lnkGo = new PageLink("lnk_go", playerPage);

    // Link lnkGo = new BookmarkablePageLink("lnk_go", PlayerPage.class, getParametersForPackage(pkg) );
    if (StringUtils.isNotBlank(pkg.getTitle())) {

        String title = pkg.getTitle();

        PopupSettings popupSettings = new PopupSettings(PageMap.forName(title), PopupSettings.RESIZABLE);
        popupSettings.setWidth(1020);
        popupSettings.setHeight(740);

        popupSettings.setWindowName(title);

        lnkGo.setPopupSettings(popupSettings);
    }

    lnkGo.setEnabled(true);
    lnkGo.setVisible(true);

    final PageParameters params = getParametersForPackage(pkg);
    params.add("no-toolbar", "true");

    String context = lms.currentContext();
    final boolean canConfigure = lms.canConfigure(context);
    final boolean canViewResults = lms.canViewResults(context);
    final boolean canGrade = lms.canGrade(context);

    Link<?> lnkConfigure = new Link("lnk_configure") {
        @Override
        public void onClick() {
            setResponsePage(new PackageConfigurationPage(params));
        }
    };
    lnkConfigure.setVisible(canConfigure);

    // the following link points to the results page for the designated package
    /*
     * if (canViewResults) { actionColumn.addAction(new Action(new StringResourceModel("column.action.grade.label", this, null), LearnerResultsPage.class, paramPropertyExpressions)); }
     */
    Link<?> lnkResults = new Link("lnk_results") {
        @Override
        public void onClick() {
            Page resultsPage = new LearnerResultsPage(getParametersForPersonalResults(pkg));
            if (canGrade) {
                resultsPage = new ResultsListPage(getParametersForResultsList(pkg));
            }
            setResponsePage(resultsPage);
        }
    };
    lnkResults.setVisible(canViewResults || canGrade);

    // add links to page
    add(lnkGo);
    add(lnkConfigure);
    add(lnkResults);
}

From source file:org.sakaiproject.scorm.ui.console.pages.PackageListPage.java

License:Educational Community License

public PackageListPage(PageParameters params) {

    List<ContentPackage> contentPackages = contentService.getContentPackages();

    final String context = lms.currentContext();
    final boolean canConfigure = lms.canConfigure(context);
    final boolean canGrade = lms.canGrade(context);
    final boolean canViewResults = lms.canViewResults(context);
    final boolean canDelete = lms.canDelete(context);

    List<IColumn<ContentPackage>> columns = new LinkedList<IColumn<ContentPackage>>();

    ActionColumn actionColumn = new ActionColumn(
            new StringResourceModel("column.header.content.package.name", this, null), "title", "title");

    String[] paramPropertyExpressions = { "contentPackageId", "resourceId", "title" };

    Action launchAction = new Action("title", PlayerPage.class, paramPropertyExpressions) {
        private static final long serialVersionUID = 1L;

        @Override//from   ww w.j  av  a 2  s .c om
        public Component newLink(String id, Object bean) {
            IModel<String> labelModel;
            if (displayModel != null) {
                labelModel = displayModel;
            } else {
                String labelValue = String.valueOf(PropertyResolver.getValue(labelPropertyExpression, bean));
                labelModel = new Model<String>(labelValue);
            }

            PageParameters params = buildPageParameters(paramPropertyExpressions, bean);
            Link link = new BookmarkablePageLabeledLink(id, labelModel, pageClass, params);

            if (popupWindowName != null) {
                PopupSettings popupSettings = new PopupSettings(PageMap.forName(popupWindowName),
                        PopupSettings.RESIZABLE);
                popupSettings.setWidth(1020);
                popupSettings.setHeight(740);

                popupSettings.setWindowName(popupWindowName);

                link.setPopupSettings(popupSettings);
            }

            link.setEnabled(isEnabled(bean) && lms.canLaunch((ContentPackage) bean));
            link.setVisible(isVisible(bean));

            return link;
        }
    };

    actionColumn.addAction(launchAction);

    if (lms.canLaunchNewWindow()) {
        launchAction.setPopupWindowName("ScormPlayer");
    }

    if (canConfigure) {
        actionColumn.addAction(new Action(new ResourceModel("column.action.edit.label"),
                PackageConfigurationPage.class, paramPropertyExpressions));
    }
    if (canGrade) {
        actionColumn.addAction(new Action(new StringResourceModel("column.action.grade.label", this, null),
                ResultsListPage.class, paramPropertyExpressions));
    } else if (canViewResults) {
        actionColumn.addAction(new Action(new StringResourceModel("column.action.grade.label", this, null),
                LearnerResultsPage.class, paramPropertyExpressions));
    }

    columns.add(actionColumn);

    columns.add(new StatusColumn(new StringResourceModel("column.header.status", this, null), "status"));

    columns.add(new DecoratedDatePropertyColumn(new StringResourceModel("column.header.releaseOn", this, null),
            "releaseOn", "releaseOn"));

    columns.add(new DecoratedDatePropertyColumn(new StringResourceModel("column.header.dueOn", this, null),
            "dueOn", "dueOn"));

    if (canDelete) {
        columns.add(new ImageLinkColumn(new Model("Remove"), PackageRemovePage.class, paramPropertyExpressions,
                DELETE_ICON, "delete"));
    }

    BasicDataTable table = new BasicDataTable("cpTable", columns, contentPackages);

    add(table);
}

From source file:org.sakaiproject.wicket.markup.html.repeater.data.table.Action.java

License:Educational Community License

public Component newLink(String id, Object bean) {
    IModel labelModel = null;//from w  w w. j a  v a  2s.  co m
    if (displayModel != null) {
        labelModel = displayModel;
    } else {
        String labelValue = String.valueOf(PropertyResolver.getValue(labelPropertyExpression, bean));
        labelModel = new Model(labelValue);
    }

    PageParameters params = buildPageParameters(paramPropertyExpressions, bean);
    Link link = new BookmarkablePageLabeledLink(id, labelModel, pageClass, params);

    if (popupWindowName != null) {
        PopupSettings popupSettings = new PopupSettings(PageMap.forName(popupWindowName),
                PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS);

        popupSettings.setWindowName(popupWindowName);

        link.setPopupSettings(popupSettings);
    }

    link.setEnabled(isEnabled(bean));
    link.setVisible(isVisible(bean));

    return link;
}