List of usage examples for org.apache.wicket.markup.html.link PopupSettings RESIZABLE
int RESIZABLE
To view the source code for org.apache.wicket.markup.html.link PopupSettings RESIZABLE.
Click Source Link
From source file:com.asptt.plongee.resa.util.UtilsFSpdf.java
public ResourceLink createWebResourcePdf(final Adherent adherent, final FicheSecurite fs) { Resource pdfResource = new WebResource() { @Override// w w w. j a v a2 s . c o m public IResourceStream getResourceStream() { String nom = adherent.getNom(); final String realPath; if (null != fs) { realPath = catalinaBasePath.concat(Parameters.getString("fs.path")).concat(nom).concat("_FS") .concat(".pdf"); // Cration du pdf try { createPdfFS(realPath, fs); } catch (com.itextpdf.io.IOException ex) { java.util.logging.Logger.getLogger(UpdateListeFS.class.getName()).log(Level.SEVERE, null, ex); } catch (java.io.IOException ex) { java.util.logging.Logger.getLogger(UpdateListeFS.class.getName()).log(Level.SEVERE, null, ex); } } else { //Recherche du Certificat mdical nom = nom.substring(0, 1).toUpperCase() + nom.substring(1).toLowerCase(); String license = adherent.getNumeroLicense(); realPath = catalinaBasePath.concat(Parameters.getString("cm.path")).concat(nom).concat("_") .concat(license).concat(".pdf"); } java.io.File file = new java.io.File(realPath); // created FileResourceStream object by passing the above File object name "pdfFile". IResourceStream stream = new FileResourceStream(file); file.deleteOnExit(); //finally returns the stream return stream; } }; /* * Created PopupSettings object named "popupSettings" by passing some parameters in the * constructor and also setted the width and height for popup window. */ PopupSettings popupSettings = new PopupSettings(PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS) .setHeight(500).setWidth(700); /* * Created ResourceLink object named "resourceLink" by passing above Resource object * named "pdfResource" as second parameters.The first parameter is "wicket:id" by which * markup identifies the component and renders it on web page. */ ResourceLink resourceLink = (ResourceLink) new ResourceLink("openPdf", pdfResource); //Setted the popupSettings properties of "resourceLink". resourceLink.setPopupSettings(popupSettings); //if file not found disable resourcelink in case of certificat mdical (fs == null) if (null == fs) { try { pdfResource.getResourceStream().getInputStream(); } catch (ResourceStreamNotFoundException ex) { resourceLink.setEnabled(false); } } //return resourceLink for added in page return resourceLink; }
From source file:com.lili.WicketExampleHeader.java
License:Apache License
/** * Construct.//from w ww . j a v a 2 s .c o m * * @param id * id of the component * @param exampleTitle * title of the example * @param page * The example page */ public WicketExampleHeader(String id, String exampleTitle, WebPage page) { super(id); // add(new DebugBar("debug")); // add(new Label("exampleTitle", exampleTitle)); // BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>("sources", // SourcesPage.class, SourcesPage.generatePageParameters(page)); // BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>("sources", // null,null); // add(link); PopupSettings settings = new PopupSettings("sources", PopupSettings.RESIZABLE); settings.setWidth(800); settings.setHeight(600); // link.setPopupSettings(settings); }
From source file:com.marintek.isis.wicket.ui.components.scalars.wicket.StandaloneValueAsPopupWicketBox.java
License:Apache License
private void buildGui() { PopupWicketBox fb;/*from w w w.j a v a 2s . c o m*/ 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:com.mastfrog.acteur.wicket.borrowed.WicketExampleHeader.java
License:Apache License
/** * Construct./*from w w w . java2 s. com*/ * * @param id * id of the component * @param exampleTitle * title of the example * @param page * The example page */ public WicketExampleHeader(String id, String exampleTitle, WebPage page) { super(id); // add(new DebugBar("debug")); add(new Label("exampleTitle", exampleTitle)); BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>("sources", SourcesPage.class, SourcesPage.generatePageParameters(page)); add(link); PopupSettings settings = new PopupSettings("sources", PopupSettings.RESIZABLE); settings.setWidth(800); settings.setHeight(600); link.setPopupSettings(settings); }
From source file:com.norconex.jefmon.instance.action.ActionsCell.java
License:Apache License
@SuppressWarnings("nls") public ActionsCell(final String id, final JobStatusTreeNode job, final List<IJobAction> actions) { super(id);//from ww w. j a va 2s. co m add(new ListView<IJobAction>("actions", actions) { private static final long serialVersionUID = 3635147316426384496L; @Override protected void populateItem(ListItem<IJobAction> item) { final IJobAction action = item.getModelObject(); if (action.isVisible(job)) { String icon = action.getFontIcon(); final String pageName = action.getName().getObject() + " - " + job.getJobId(); Link<String> link = new Link<String>("actionLink") { private static final long serialVersionUID = 3488334322744811811L; @Override public void onClick() { Component comp = action.execute(job, ActionPage.COMPONENT_ID); if (comp != null) { setResponsePage(new ActionPage(comp, Model.of(pageName))); } } }; PopupSettings popup = new PopupSettings(pageName, PopupSettings.RESIZABLE); popup.setWidth(800); link.setPopupSettings(popup); link.add(new Label("actionIcon").add(new CssClass(icon))); link.add(new BootstrapTooltip(action.getName())); item.add(link); } else { WebMarkupContainer empty = new WebMarkupContainer("actionLink"); empty.add(new Label("actionIcon")); empty.setVisible(false); item.add(empty); } } }); }
From source file:de.twenty11.skysail.client.osgimonitor.wicket.pages.bundles.WicketExampleHeader.java
License:Apache License
/** * Construct.// w w w . ja va2s. co m * * @param id * id of the component * @param exampleTitle * title of the example * @param page * The example page */ public WicketExampleHeader(String id, String exampleTitle, WebPage page) { super(id); //add(new DebugBar("debug")); add(new Label("exampleTitle", exampleTitle)); // BookmarkablePageLink<Void> link = new BookmarkablePageLink<Void>("sources", // SourcesPage.class, SourcesPage.generatePageParameters(page)); //add(link); PopupSettings settings = new PopupSettings("sources", PopupSettings.RESIZABLE); settings.setWidth(800); settings.setHeight(600); //link.setPopupSettings(settings); }
From source file:jp.go.nict.langrid.management.web.view.component.link.PopupLink.java
License:Open Source License
/** * /*ww w . j a v a2 s . co m*/ * */ public PopupLink(final String label, String id, final String uniqueId, Class<T> pageClass) { super(label, pageClass); setParameter("id", id); settings = new PopupSettings(PopupSettings.SCROLLBARS | PopupSettings.RESIZABLE); settings.setHeight(HEIGHT); settings.setWidth(WIDTH); settings.setTop(TOP); settings.setLeft(LEFT); setPopupSettings(settings); }
From source file:jp.go.nict.langrid.management.web.view.page.user.component.link.ExternalHomePageLink.java
License:Open Source License
/** * /*from w w w . j a va2 s.com*/ * */ public ExternalHomePageLink(String componentId, String url, String uniqueId) { super(componentId, url); PopupSettings settings = new PopupSettings(PageMap.forName(componentId.concat(uniqueId)), PopupSettings.SCROLLBARS | PopupSettings.RESIZABLE | PopupSettings.MENU_BAR | PopupSettings.LOCATION_BAR | PopupSettings.STATUS_BAR | PopupSettings.TOOL_BAR); settings.setHeight(HEIGHT); settings.setWidth(WIDTH); setPopupSettings(settings); add(createLabel(componentId, url).add(new AttributeAppender("title", new Model<String>(url), " "))); }
From source file:jp.go.nict.langrid.management.web.view.page.user.component.link.ExternalHomePageLink.java
License:Open Source License
/** * // w w w. j a va 2 s . co m * */ public ExternalHomePageLink(String componentId, String url, String uniqueId, int limit) { super(componentId, url); PopupSettings settings = new PopupSettings(PageMap.forName(componentId.concat(uniqueId)), PopupSettings.SCROLLBARS | PopupSettings.RESIZABLE | PopupSettings.MENU_BAR | PopupSettings.LOCATION_BAR | PopupSettings.STATUS_BAR | PopupSettings.TOOL_BAR); settings.setHeight(HEIGHT); settings.setWidth(WIDTH); setPopupSettings(settings); if (url == null || url.equals("")) { url = "-"; } add(createLabel(componentId, StringUtil.shortenString(url, limit)) .add(new AttributeAppender("title", new Model<String>(url), " "))); setEnabled(!(url == null || url.equals("") || url.equals("-"))); }
From source file:ontopoly.components.FieldInstanceURIField.java
License:Apache License
public FieldInstanceURIField(String id, FieldValueModel _fieldValueModel) { super(id);/*from ww w . j ava2 s .c o m*/ this.fieldValueModel = _fieldValueModel; if (!fieldValueModel.isExistingValue()) { this.oldValue = null; } else { Object value = fieldValueModel.getObject(); if (value instanceof OccurrenceIF) { OccurrenceIF occ = (OccurrenceIF) value; this.oldValue = occ.getValue(); } else if (value instanceof LocatorIF) { LocatorIF identity = (LocatorIF) value; this.oldValue = identity.getAddress(); } else { throw new RuntimeException("Unsupported field value: " + value); } } this.textField = new TextField<String>("input", new Model<String>(oldValue)) { @Override public boolean isEnabled() { return FieldInstanceURIField.this.isEnabled(); } @Override protected void onComponentTag(ComponentTag tag) { tag.setName("input"); tag.put("type", "text"); tag.put("size", cols); super.onComponentTag(tag); } @Override protected void onModelChanged() { super.onModelChanged(); String newValue = getModelObject(); if (ObjectUtils.equals(newValue, oldValue)) return; AbstractOntopolyPage page = (AbstractOntopolyPage) getPage(); FieldInstance fieldInstance = fieldValueModel.getFieldInstanceModel().getFieldInstance(); if (fieldValueModel.isExistingValue() && oldValue != null) fieldInstance.removeValue(oldValue, page.getListener()); if (newValue != null && !newValue.equals("")) { fieldInstance.addValue(newValue, page.getListener()); fieldValueModel.setExistingValue(newValue); } oldValue = newValue; } }; if (fieldValueModel.getFieldInstanceModel().getFieldType() == FieldDefinition.FIELD_TYPE_IDENTITY) { textField.add(new IdentityValidator(this, fieldValueModel.getFieldInstanceModel())); } else { textField.add(new URIValidator(this, fieldValueModel.getFieldInstanceModel())); } add(textField); this.button = new ExternalLink("button", new AbstractReadOnlyModel<String>() { @Override public String getObject() { return textField.getModelObject(); } }) { @Override public boolean isVisible() { return textField.getModelObject() != null; } }; button.setOutputMarkupId(true); button.setPopupSettings( new PopupSettings(PopupSettings.LOCATION_BAR | PopupSettings.MENU_BAR | PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS | PopupSettings.STATUS_BAR | PopupSettings.TOOL_BAR)); button.add(new OntopolyImage("icon", "goto.gif")); add(button); // validate field using registered validators ExternalValidation.validate(textField, oldValue); }