List of usage examples for org.apache.wicket.markup.html WebMarkupContainer WebMarkupContainer
public WebMarkupContainer(final String id)
From source file:$.BootstrapFeedbackPanel.java
License:Apache License
/** * @see org.apache.wicket.Component#Component(String) * /*ww w . ja v a 2s . c o m*/ * @param id * @param filter */ public BootstrapFeedbackPanel(final String id, IFeedbackMessageFilter filter) { super(id); WebMarkupContainer messagesContainer = new WebMarkupContainer("feedbackDiv") { private static final long serialVersionUID = 1L; @Override public boolean isVisible() { return anyMessage(); } }; add(messagesContainer); messageListView = new MessageListView("messages"); messageListView.setVersioned(false); messagesContainer.add(messageListView); if (filter != null) { setFilter(filter); } }
From source file:abid.password.wicket.pages.LoginPage.java
License:Apache License
public LoginPage() { LoginPanel loginPanel = new LoginPanel("loginPanel"); add(loginPanel);/* w ww . j a va 2s. c om*/ LoadableDetachableModel<List<User>> usersModel = new LoadableDetachableModel<List<User>>() { private static final long serialVersionUID = 1L; @Override protected List<User> load() { return userService.getUsers(); } }; PageableListView<User> dataList = new PageableListView<User>("usersList", usersModel, 100) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<User> item) { final User data = item.getModelObject(); Label userLabel = new Label("userLabel", data.getUsername()); Label passLabel = new Label("passLabel", data.getPassword()); try { Password password = new MutablePasswordParser().parse(data.getPassword()); if (password instanceof MutablePassword) { MutablePassword mutablePassword = (MutablePassword) password; String evalatedPassword = mutablePassword.getEvaluatedPassword(); passLabel = new Label("passLabel", evalatedPassword); } } catch (Exception e) { log.error("Could not create the mutable password", e); } item.add(userLabel); item.add(passLabel); } }; int refreshTime = 3; final WebMarkupContainer usersContainer = new WebMarkupContainer("usersContainer"); usersContainer.setOutputMarkupId(true); usersContainer.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshTime))); usersContainer.add(dataList); String refreshInformation = String.format("Password refreshes every %s seconds.", refreshTime); String javascriptDisabledMsg = "Javascript is disabled you will need to refresh the page manually."; AjaxFallbackLabel refreshLabel = new AjaxFallbackLabel("refreshInformation", refreshInformation, javascriptDisabledMsg); add(usersContainer); add(refreshLabel); }
From source file:abid.password.wicket.pages.UsersPage.java
License:Apache License
public UsersPage() { LoadableDetachableModel<List<User>> usersModel = new LoadableDetachableModel<List<User>>() { private static final long serialVersionUID = 1L; @Override//from w w w . ja va2s. c om protected List<User> load() { return userService.getUsers(); } }; PageableListView<User> dataList = new PageableListView<User>("usersList", usersModel, 100) { private static final long serialVersionUID = 1L; @Override protected void populateItem(ListItem<User> item) { final User data = item.getModelObject(); Label userLabel = new Label("userLabel", data.getUsername()); Label passLabel = new Label("passLabel", data.getPassword()); try { Password password = new MutablePasswordParser().parse(data.getPassword()); if (password instanceof MutablePassword) { MutablePassword mutablePassword = (MutablePassword) password; String evalatedPassword = mutablePassword.getEvaluatedPassword(); passLabel = new Label("passLabel", evalatedPassword); } } catch (Exception e) { log.error("Could not create the mutable password", e); } item.add(userLabel); item.add(passLabel); } }; int refreshTime = 3; final WebMarkupContainer dataContainer = new WebMarkupContainer("dataContainer"); dataContainer.setOutputMarkupId(true); dataContainer.add(new AjaxSelfUpdatingTimerBehavior(Duration.seconds(refreshTime))); dataContainer.add(dataList); String refreshInformation = String.format("Password refreshes every %s seconds.", refreshTime); String javascriptDisabledMsg = "Javascript is disabled you will need to refresh the page manually."; AjaxFallbackLabel refreshInfoLabel = new AjaxFallbackLabel("refreshInformation", refreshInformation, javascriptDisabledMsg); add(dataContainer); add(refreshInfoLabel); }
From source file:ar.edu.unq.dopplereffect.presentation.panel.upload.UploadPanel.java
License:Apache License
protected void addButtons() { WebMarkupContainer ajaxButton = new WebMarkupContainer("aceptar"); ajaxButton.add(new WiQueryEventBehavior(new Event(MouseEvent.CLICK) { private static final long serialVersionUID = 1L; @Override/*from ww w. j a v a 2s . c om*/ public JsScope callback() { return JsScope.quickScope(UploadPanel.this.getDialogSelectedTypeToExport().open().render()); } })); ajaxButton.add(new ButtonBehavior()); this.add(ajaxButton); }
From source file:at.ac.tuwien.ifs.tita.ui.administration.project.ProjectAdministrationPanel.java
License:Apache License
/** * public constructor.// w w w . java2 s. co m * * @param id the name of the Panel */ public ProjectAdministrationPanel(String id) { super(id); try { projectStati = titaProjectService.getAvailableProjectStati(); } catch (PersistenceException e) { log.error("Could not load Project Stati, empty list will be initialized"); projectStati = new ArrayList<ProjectStatus>(); } // init the two WebmarkupContainer // Note, they have the same id for switching between them listContainer = new WebMarkupContainer("listContainer"); listContainer.setOutputMarkupId(true); listContainer.setOutputMarkupPlaceholderTag(true); addOrReplace(listContainer); detailContainer = new WebMarkupContainer("detailContainer"); detailContainer.setOutputMarkupId(true); detailContainer.setOutputMarkupPlaceholderTag(true); addOrReplace(detailContainer); issueTrackerContainer = new WebMarkupContainer("issueTrackerContainer"); issueTrackerContainer.setOutputMarkupId(true); issueTrackerContainer.setOutputMarkupPlaceholderTag(true); addOrReplace(issueTrackerContainer); try { Set<IssueTrackerLogin> issueTrackerLogins = userService .getUserByUsername(TitaSession.getSession().getUsername()).getIssueTrackerLogins(); issueTracker = new ArrayList<IssueTracker>(); issueTrackerLoginMap = new HashMap<String, IssueTrackerLogin>(); issueTracker = titaProjectService.getAvailableIssueTracker(); } catch (Exception e) { error("Could not load available IssueTracker for current User"); } loadListEntities(); this.setOutputMarkupId(true); this.setOutputMarkupPlaceholderTag(true); }
From source file:at.ac.tuwien.ifs.tita.ui.administration.user.UserAdministrationPanel.java
License:Apache License
/** * public constructor.//from ww w . j a v a2 s.c o m * * @param id the name of the Panel */ public UserAdministrationPanel(String id) { super(id); // init the two WebmarkupContainer // Note, they have the same id for switching between them listContainer = new WebMarkupContainer("listContainer"); listContainer.setOutputMarkupId(true); listContainer.setOutputMarkupPlaceholderTag(true); detailContainer = new WebMarkupContainer("detailContainer"); detailContainer.setOutputMarkupId(true); detailContainer.setOutputMarkupPlaceholderTag(true); addOrReplace(listContainer); addOrReplace(detailContainer); userProjectPanel = new UserProjectPanel("userProjectPanel", new TiTAUser(), this); userIssueTrackerPanel = new UserIssueTrackerLoginPanel("userIssueTrackerLoginPanel", new TiTAUser(), this); addOrReplace(userProjectPanel); addOrReplace(userIssueTrackerPanel); add(new FeedbackPanel("feedback").setOutputMarkupId(true)); // displayDetailsPage(new TiTAUser()); // displayProjectPanel(); // displayIssueTrackerLoginPanel(); loadListEntities(); this.setOutputMarkupId(true); this.setOutputMarkupPlaceholderTag(true); }
From source file:at.ac.tuwien.ifs.tita.ui.administration.user.UserIssueTrackerLoginPanel.java
License:Apache License
/** * public Contructor./*from w w w . ja v a 2 s. com*/ * * @param id the unique ID that is declared in the HTML-File for this Panel. * @param user the User to add the IssueTrackerLogins. * @param parent the Parent Panel for closing and returning a User. */ public UserIssueTrackerLoginPanel(final String id, final TiTAUser user, final UserAdministrationPanel parent) { super(id); this.parent = parent; if (user == null) { this.user = new TiTAUser(); } else { this.user = user; } list = new ArrayList<IssueTrackerLogin>(); if (user != null) { if (user.getIssueTrackerLogins() != null) { for (IssueTrackerLogin login : user.getIssueTrackerLogins()) { list.add(login); } } } container = new WebMarkupContainer("userIssueTrackerLoginContainer"); container.setOutputMarkupId(true); container.setOutputMarkupPlaceholderTag(true); addOrReplace(container); displayDetailsPage(new IssueTrackerLogin()); displayTable(list); }
From source file:at.ac.tuwien.ifs.tita.ui.administration.user.UserProjectPanel.java
License:Apache License
/** * public constructor./*from w w w. j av a2s. c o m*/ * * @param id the unique ID that is declared in the HTML-File for this Panel. * @param user the User to add the Projects * @param parent the Parent Panel for Returning a User on Close. */ public UserProjectPanel(String id, TiTAUser user, UserAdministrationPanel parent) { super(id); this.parent = parent; if (user == null) { this.user = new TiTAUser(); } else { this.user = user; } try { list = service.getOrderedProjects(0, "name"); } catch (PersistenceException e) { log.error("could not load List of TiTAProjects, empty List will be created"); list = new ArrayList<TiTAProject>(); } tm = new TableModelProjectWithoutButton(list); table = new Table("userProjectTable", tm) { @Override protected void onSelection(AjaxRequestTarget target) { if (!(table.getSelectedRows()[0] == tm.getSelectedRow())) { tm.setSelectedRow(table.getSelectedRows()[0]); tm.reload(); target.addComponent(table); } } }; table.setWidths(EffortUtils.WIDTHS); if (this.user.getTitaUserProjects() != null) { this.actualProjects = new ArrayList<TiTAUserProject>(this.user.getTitaUserProjects()); } else { this.actualProjects = new ArrayList<TiTAUserProject>(); } actualProjectsTM = new TableModelUserProject(actualProjects); actualProjectsTable = new Table("actualUserProjectTable", actualProjectsTM); actualProjectsTable.setWidths(EffortUtils.WIDTHS); container = new WebMarkupContainer("userProjectContainer"); container.setOutputMarkupId(true); container.setOutputMarkupPlaceholderTag(true); addOrReplace(container); add(new FeedbackPanel("feedback").setOutputMarkupId(true)); displayTables(); addButtons(); }
From source file:at.ac.tuwien.ifs.tita.ui.BasePage.java
License:Apache License
public BasePage() { initLogoutLink();/*w w w . j av a 2s . com*/ String username = TitaSession.getSession().getUsername(); add(new Label("showUser", "Signed in as " + username)); final WebMarkupContainer timeConsumergroup = new WebMarkupContainer("timeConsumerGroup"); final WebMarkupContainer timeControllergroup = new WebMarkupContainer("timeControllerGroup"); final WebMarkupContainer administratorGroup = new WebMarkupContainer("administratorGroup"); addAdminLinks(administratorGroup); addTimeConsumerLinks(timeConsumergroup); addTimeControllerLinks(timeControllergroup); add(timeConsumergroup); add(timeControllergroup); add(administratorGroup); }
From source file:at.ac.tuwien.ifs.tita.ui.controls.panel.AdministrationPanelEffort.java
License:Apache License
/** * Displays panel.//from w w w . j a v a 2 s.c om */ private void displayPanel() { // get time efforts loadListEntities(); tm = new TableModelEffort(timeeffortList); // add form components to the form as usual timeeffortContainer = new WebMarkupContainer("timeeffortContainer"); timeeffortContainer.setOutputMarkupId(true); timeeffortContainer.setOutputMarkupPlaceholderTag(true); add(timeeffortContainer); form = new Form<Effort>("timeeffortForm"); add(form); form.setOutputMarkupId(true); // Data table displayDataTable(); // Text fields displayTextFields(); // Filter text fields displayFilterFields(); }