List of usage examples for org.apache.wicket.markup.html.link PopupSettings LOCATION_BAR
int LOCATION_BAR
To view the source code for org.apache.wicket.markup.html.link PopupSettings LOCATION_BAR.
Click Source Link
From source file:de.tudarmstadt.ukp.csniper.webapp.support.wicket.ThresholdLink.java
License:Apache License
public ThresholdLink(String aId, int aWidth, int aHeight) { super(aId);/*from ww w . jav a2s . c o m*/ PopupSettings ps = new PopupSettings(aId, PopupSettings.SCROLLBARS + PopupSettings.LOCATION_BAR); ps.setWidth(aWidth); ps.setHeight(aHeight); setPopupSettings(ps); setBody(new Model<String>( "<img src=\"images/questionmark.png\" alt=\"Explanation\" style=\"vertical-align:bottom\" />")); setEscapeModelStrings(false); }
From source file:jp.go.nict.langrid.management.web.view.page.user.component.link.ExternalHomePageLink.java
License:Open Source License
/** * /*from www .ja v a 2 s .c o m*/ * */ 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
/** * /* ww w. jav a 2s.c om*/ * */ 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 www .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); }
From source file:org.efaps.ui.wicket.pages.content.AbstractContentPage.java
License:Apache License
/** * Method that adds the Components to the Page. * * @param _form FormContainer//w w w. j ava 2s. c o m * @throws EFapsException on error */ protected void addComponents(final FormContainer _form) throws EFapsException { this.form = _form; add(new KeepAliveBehavior()); // set the title for the Page add2Page(new Label("pageTitle", DBProperties.getProperty("Logo.Version.Label"))); add(new SetMessageStatusBehavior()); add(this.modal); final AbstractUIObject uiObject = (AbstractUIObject) super.getDefaultModelObject(); add(new HeadingPanel("titel", Model.of(new UIHeading(uiObject.getTitle())))); IModel<UIMenuItem> model = null; if (uiObject.getMode() == TargetMode.SEARCH && uiObject.getCallingCommandUUID() != null && uiObject instanceof UIForm) { model = Model.of(new UISearchItem(uiObject.getCallingCommand().getTargetSearch().getUUID())); } else if (uiObject.getCommand().getTargetMenu() != null) { model = Model .of(new UIMenuItem(uiObject.getCommand().getTargetMenu().getUUID(), uiObject.getInstanceKey())); } add(new MenuBarPanel("menu", model)); final WebMarkupContainer exLink; if (((AbstractUIPageObject) super.getDefaultModelObject()).getHelpTarget() != null) { final PopupSettings set = new PopupSettings( PopupSettings.RESIZABLE | PopupSettings.SCROLLBARS | PopupSettings.MENU_BAR | PopupSettings.LOCATION_BAR | PopupSettings.STATUS_BAR | PopupSettings.TOOL_BAR); exLink = new ExternalLink("help", "/servlet/help/" + ((AbstractUIPageObject) super.getDefaultModelObject()).getHelpTarget(), DBProperties.getProperty("org.efaps.ui.wicket.pages.content.AbstractContentPage.HelpLink")) .setPopupSettings(set).setContextRelative(true); exLink.add(AttributeModifier.append("class", "eFapsHelpLink")); if (true) { exLink.add(AttributeModifier.append("class", " eFapsHelpMainLink")); } } else { exLink = new WebMarkupContainer("help"); exLink.setVisible(false); } add(exLink); WebMarkupContainer footerpanel; if (uiObject.isCreateMode() || uiObject.isEditMode() || uiObject.isSearchMode() || uiObject.isOpenedByPicker()) { footerpanel = new FooterPanel("footer", getDefaultModel(), this.modalWindow, _form); } else { footerpanel = new WebMarkupContainer("footer"); footerpanel.setVisible(false); } add(footerpanel); }