Example usage for org.apache.wicket AttributeModifier AttributeModifier

List of usage examples for org.apache.wicket AttributeModifier AttributeModifier

Introduction

In this page you can find the example usage for org.apache.wicket AttributeModifier AttributeModifier.

Prototype

public AttributeModifier(String attribute, Serializable value) 

Source Link

Document

Create a new attribute modifier with the given attribute name and model to replace with.

Usage

From source file:$.ModalLink.java

License:Apache License

@Override
    protected void onComponentTag(ComponentTag tag) {
        checkComponentTag(tag, "a");
        super.onComponentTag(tag);
        AttributeModifier href = new AttributeModifier("href", "#" + targetId);
        AttributeModifier dataToggle = new AttributeModifier("data-toggle", "modal");
        tag.addBehavior(href);/*from   w  ww. j a  v a 2  s .  c  om*/
        tag.addBehavior(dataToggle);
    }

From source file:$.ModalPanel.java

License:Apache License

@Override
    protected void onComponentTag(ComponentTag tag) {
        AttributeModifier attr = new AttributeModifier("class", cssClass);
        tag.addBehavior(attr);// w ww  . j a  v  a  2s .c o m
        super.onComponentTag(tag);
    }

From source file:at.molindo.wicketutils.dev.MarkupSourceAttributeAppender.java

License:Apache License

@Override
public void onInstantiation(final Component component) {
    if (component instanceof MarkupContainer) {
        component.add(new AttributeModifier(attribute, new MarkupSourceModel((MarkupContainer) component)));
    }//from w  ww  .  j a va  2 s  .  c om
}

From source file:au.org.theark.admin.web.component.activitymonitor.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public PageableListView<ArkSubjectSessionVO> buildPageableListView(IModel iModel) {
    PageableListView<ArkSubjectSessionVO> pageableListView = new PageableListView<ArkSubjectSessionVO>("list",
            iModel,/*from w w  w  .  j a va  2s  .  c  o m*/
            iArkCommonService.getUserConfig(au.org.theark.core.Constants.CONFIG_ROWS_PER_PAGE).getIntValue()) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(final ListItem<ArkSubjectSessionVO> item) {
            final ArkSubjectSessionVO subject = (ArkSubjectSessionVO) item.getModelObject();
            final String sessionId = subject.getSessionId();
            final String userId = subject.getUserId();
            final String host = subject.getHost();
            final Date startTimestamp = subject.getStartTimestamp();
            final Date lastAccessTime = subject.getLastAccessTime();
            SimpleDateFormat sdf = new SimpleDateFormat(au.org.theark.core.Constants.DD_MM_YYYY_HH_MM_SS);

            item.add(new Label(au.org.theark.core.Constants.ARK_SESSION_ID, sessionId));
            item.add(new Label(au.org.theark.core.Constants.ARK_USERID, userId));
            item.add(new Label(au.org.theark.core.Constants.ARK_HOST, host));
            item.add(new Label(au.org.theark.core.Constants.ARK_SESSION_START_TIMESTAMP,
                    sdf.format(startTimestamp)));
            item.add(new Label(au.org.theark.core.Constants.ARK_SESSION_LAST_ACCESS_TIME,
                    sdf.format(lastAccessTime)));

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 1938679383897533820L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));
        }
    };
    return pageableListView;
}

From source file:au.org.theark.admin.web.component.function.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public DataView<ArkFunction> buildDataView(ArkDataProvider<ArkFunction, IAdminService> dataProvider) {
    DataView<ArkFunction> dataView = new DataView<ArkFunction>("arkFunctionList", dataProvider) {

        private static final long serialVersionUID = 2981419595326128410L;

        @Override//ww  w . j  ava 2s  .  c  om
        protected void populateItem(final Item<ArkFunction> item) {
            ArkFunction arkFunction = item.getModelObject();

            item.add(new Label("arkFunction.id", arkFunction.getId().toString()));
            item.add(buildLink(arkFunction));

            if (arkFunction.getDescription() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkFunction.description", arkFunction.getDescription()));
            } else {
                item.add(new Label("arkFunction.description", ""));
            }

            if (arkFunction.getArkFunctionType() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkFunction.arkFunctionType", arkFunction.getArkFunctionType().getName()));
            } else {
                item.add(new Label("arkFunction.arkFunctionType", ""));
            }

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 5761909841047153853L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));
        }
    };
    return dataView;
}

From source file:au.org.theark.admin.web.component.function.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public PageableListView<ArkFunction> buildPageableListView(IModel iModel,
        final WebMarkupContainer searchResultsContainer) {
    PageableListView<ArkFunction> pageableListView = new PageableListView<ArkFunction>("arkFunctionList",
            iModel,// w  w  w  .java  2  s.co m
            iArkCommonService.getUserConfig(au.org.theark.core.Constants.CONFIG_ROWS_PER_PAGE).getIntValue()) {

        private static final long serialVersionUID = 3350183112731574263L;

        @Override
        protected void populateItem(final ListItem<ArkFunction> item) {

            ArkFunction arkFunction = item.getModelObject();

            item.add(buildLink(arkFunction));

            if (arkFunction.getName() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkFunction.name", arkFunction.getName()));
            } else {
                item.add(new Label("arkFunction.name", ""));
            }

            if (arkFunction.getDescription() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkFunction.description", arkFunction.getDescription()));
            } else {
                item.add(new Label("arkFunction.description", ""));
            }

            if (arkFunction.getArkFunctionType() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkFunction.arkFunctionType", arkFunction.getArkFunctionType().getName()));
            } else {
                item.add(new Label("arkFunction.arkFunctionType", ""));
            }

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 1938679383897533820L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));

        }
    };
    return pageableListView;
}

From source file:au.org.theark.admin.web.component.module.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public DataView<ArkModule> buildDataView(ArkDataProvider<ArkModule, IAdminService> dataProvider) {
    DataView<ArkModule> dataView = new DataView<ArkModule>("arkModuleList", dataProvider) {

        private static final long serialVersionUID = 2981419595326128410L;

        @Override/*  www  .  jav a  2 s.  com*/
        protected void populateItem(final Item<ArkModule> item) {
            ArkModule arkModule = item.getModelObject();

            item.add(new Label("arkModule.id", arkModule.getId().toString()));

            item.add(buildLink(arkModule));

            if (arkModule.getDescription() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkModule.description", arkModule.getDescription()));
            } else {
                item.add(new Label("arkModule.description", ""));
            }

            item.add(new Label("arkModule.enabled", arkModule.getEnabled() ? "Enabled" : "Disabled"));

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 5761909841047153853L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));
        }
    };
    return dataView;
}

From source file:au.org.theark.admin.web.component.module.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public PageableListView<ArkModule> buildPageableListView(IModel iModel,
        final WebMarkupContainer searchResultsContainer) {
    PageableListView<ArkModule> pageableListView = new PageableListView<ArkModule>("arkModuleList", iModel,
            iArkCommonService.getUserConfig(au.org.theark.core.Constants.CONFIG_ROWS_PER_PAGE).getIntValue()) {

        private static final long serialVersionUID = 3350183112731574263L;

        @Override/*from  w  w w.  ja  v a2 s. c o m*/
        protected void populateItem(final ListItem<ArkModule> item) {
            ArkModule arkModule = item.getModelObject();

            item.add(buildLink(arkModule));

            if (arkModule.getName() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkModule.name", arkModule.getName()));
            } else {
                item.add(new Label("arkModule.name", ""));
            }

            if (arkModule.getDescription() != null) {
                // the ID here must match the ones in mark-up
                item.add(new Label("arkModule.description", arkModule.getDescription()));
            } else {
                item.add(new Label("arkModule.description", ""));
            }

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 1938679383897533820L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));

        }
    };
    return pageableListView;
}

From source file:au.org.theark.admin.web.component.modulefunction.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public DataView<ArkModuleFunction> buildDataView(
        ArkDataProvider<ArkModuleFunction, IAdminService> dataProvider) {
    DataView<ArkModuleFunction> dataView = new DataView<ArkModuleFunction>("arkModuleFunctionList",
            dataProvider) {/*from   w w w .jav a 2 s. c  om*/

        private static final long serialVersionUID = 2981419595326128410L;

        @Override
        protected void populateItem(final Item<ArkModuleFunction> item) {
            ArkModuleFunction arkModuleFunction = item.getModelObject();

            item.add(new Label("arkModuleFunction.id", arkModuleFunction.getId().toString()));

            item.add(buildLink(arkModuleFunction));

            if (arkModuleFunction.getArkFunction() != null) {
                item.add(new Label("arkModuleFunction.arkFunction",
                        arkModuleFunction.getArkFunction().getName()));
            } else {
                item.add(new Label("arkModuleFunction.arkFunction", ""));
            }

            if (arkModuleFunction.getFunctionSequence() != null) {
                item.add(new Label("arkModuleFunction.functionSequence",
                        arkModuleFunction.getFunctionSequence().toString()));
            } else {
                item.add(new Label("arkModuleFunction.functionSequence", ""));
            }

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 5761909841047153853L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));
        }
    };
    return dataView;
}

From source file:au.org.theark.admin.web.component.modulerole.SearchResultsPanel.java

License:Open Source License

@SuppressWarnings("unchecked")
public DataView<ArkModuleRole> buildDataView(ArkDataProvider<ArkModuleRole, IAdminService> dataProvider) {
    DataView<ArkModuleRole> dataView = new DataView<ArkModuleRole>("arkModuleRoleList", dataProvider) {

        private static final long serialVersionUID = 1L;

        @Override// ww w.j  av  a 2  s .com
        protected void populateItem(final Item<ArkModuleRole> item) {
            ArkModuleRole arkModuleRole = item.getModelObject();

            item.add(new Label("arkModuleRole.id", arkModuleRole.getId().toString()));

            item.add(buildLink(arkModuleRole));

            if (arkModuleRole.getArkRole() != null) {
                item.add(new Label("arkModuleRole.arkRole", arkModuleRole.getArkRole().getName()));
            } else {
                item.add(new Label("arkModuleRole.arkRole", ""));
            }

            item.add(new AttributeModifier("class", new AbstractReadOnlyModel<String>() {
                private static final long serialVersionUID = 5761909841047153853L;

                @Override
                public String getObject() {
                    return (item.getIndex() % 2 == 1) ? "even" : "odd";
                }
            }));
        }
    };
    return dataView;
}