http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/EntityLinkSelect2Panel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/EntityLinkSelect2Panel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/EntityLinkSelect2Panel.java deleted file mode 100644 index aab5d83..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/EntityLinkSelect2Panel.java +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.reference; - -import com.vaynberg.wicket.select2.Select2Choice; - -import org.apache.wicket.markup.html.form.FormComponentPanel; - -import org.apache.isis.core.metamodel.adapter.ObjectAdapter; -import org.apache.isis.viewer.wicket.ui.components.widgets.formcomponent.CancelHintRequired; -import org.apache.isis.viewer.wicket.ui.components.widgets.formcomponent.FormComponentPanelAbstract; - -class EntityLinkSelect2Panel extends FormComponentPanelAbstract<ObjectAdapter> implements CancelHintRequired { - - private static final long serialVersionUID = 1L; - - ReferencePanel owningPanel; - - public EntityLinkSelect2Panel(final String id, final ReferencePanel owningPanel) { - super(id, owningPanel.getModel()); - this.owningPanel = owningPanel; - - setType(ObjectAdapter.class); - } - - /** - * Necessary because {@link FormComponentPanel} overrides this as <tt>true</tt>, whereas we want to - * report on the state of the underlying {@link Select2Choice}. - */ - @Override - public boolean checkRequired() { - if(owningPanel.select2Field != null) { - return owningPanel.select2Field.checkRequired(); - } - return super.checkRequired(); - } - - /** - * Since we override {@link #convertInput()}, it is (apparently) enough to - * just return a value that is suitable for error reporting. - * - * @see DateField#getInput() for reference - */ - @Override - public String getInput() { - return owningPanel.getInput(); - } - - @Override - protected void convertInput() { - owningPanel.convertInput(); - } - - @Override - public void onCancel() { - owningPanel.getModel().clearPending(); - } - -}
http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.html deleted file mode 100644 index 0b92105..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.html +++ /dev/null @@ -1,56 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE html> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <body> - <wicket:panel> - <div class="referencePanel scalarNameAndValueComponentType"> - <div class="form-group" wicket:id="scalarIfRegular"> - <label wicket:id="scalarName" class="scalarName control-label">[Label text]</label> - <span class="scalarValueWrapper"> - <span class="entityLink"> - <div class="entityLinkSelect2Panel entityLinkComponentType"> - <div class="wrapper"> - <span class="autoCompletePlaceholder"> - <span wicket:id="entityLink">link or drop down</span> - <span wicket:id="entityIconAndTitle">[icon and title]</span> - </span> - <span class="clearfix"></span> - </div> - <span wicket:id="entityTitleIfNull">(none)</span> - </div> - </span> - <span wicket:id="feedback" class="help-block"></span> - <span wicket:id="associatedActionLinksBelow"></span> - </span> - <span wicket:id="associatedActionLinksRight"></span> - </div> - <div wicket:id="scalarIfCompact" class="scalarIfCompact"> - <div class="scalarValue"> - <div class="entityLink" wicket:id="entityLink">[property or parameter value]</div> - </div> - </div> - </div> - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java deleted file mode 100644 index 03dd77f..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanel.java +++ /dev/null @@ -1,507 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.reference; - -import javax.inject.Inject; -import java.util.List; -import com.google.common.collect.Lists; -import com.vaynberg.wicket.select2.ChoiceProvider; -import com.vaynberg.wicket.select2.Select2Choice; -import com.vaynberg.wicket.select2.Settings; -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.Component; -import org.apache.wicket.MarkupContainer; -import org.apache.wicket.behavior.Behavior; -import org.apache.wicket.markup.html.WebMarkupContainer; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.wicket.validation.IValidatable; -import org.apache.wicket.validation.IValidator; -import org.apache.wicket.validation.ValidationError; -import org.apache.isis.core.metamodel.adapter.ObjectAdapter; -import org.apache.isis.core.metamodel.adapter.mgr.AdapterManager.ConcurrencyChecking; -import org.apache.isis.core.metamodel.facets.all.named.NamedFacet; -import org.apache.isis.core.metamodel.facets.object.autocomplete.AutoCompleteFacet; -import org.apache.isis.core.metamodel.spec.ObjectSpecification; -import org.apache.isis.viewer.wicket.model.isis.WicketViewerSettings; -import org.apache.isis.viewer.wicket.model.links.LinkAndLabel; -import org.apache.isis.viewer.wicket.model.mementos.ObjectAdapterMemento; -import org.apache.isis.viewer.wicket.model.models.EntityModel; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.model.models.ScalarModelWithPending.Util; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentType; -import org.apache.isis.viewer.wicket.ui.components.actionmenu.entityactions.EntityActionUtil; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelAbstract; -import org.apache.isis.viewer.wicket.ui.components.widgets.ObjectAdapterMementoProviderAbstract; -import org.apache.isis.viewer.wicket.ui.components.widgets.bootstrap.FormGroup; -import org.apache.isis.viewer.wicket.ui.components.widgets.entitysimplelink.EntityLinkSimplePanel; -import org.apache.isis.viewer.wicket.ui.components.widgets.select2.Select2ChoiceUtil; -import org.apache.isis.viewer.wicket.ui.util.Components; -import org.apache.isis.viewer.wicket.ui.util.CssClassAppender; - -/** - * Panel for rendering scalars which of are of reference type (as opposed to - * value types). - */ -public class ReferencePanel extends ScalarPanelAbstract { - - private static final long serialVersionUID = 1L; - - private static final String ID_AUTO_COMPLETE = "autoComplete"; - private static final String ID_ENTITY_ICON_TITLE = "entityIconAndTitle"; - - private EntityLinkSelect2Panel entityLink; - Select2Choice<ObjectAdapterMemento> select2Field; - - private EntityLinkSimplePanel entitySimpleLink; - - public ReferencePanel(final String id, final ScalarModel scalarModel) { - super(id, scalarModel); - } - - - // ////////////////////////////////////// - // addComponentFor{Compact/Regular} - // ////////////////////////////////////// - - // First called as a side-effect of {@link #beforeRender()} - @Override - protected Component addComponentForCompact() { - - final ScalarModel scalarModel = getModel(); - final String name = scalarModel.getName(); - - entitySimpleLink = (EntityLinkSimplePanel) getComponentFactoryRegistry().createComponent(ComponentType.ENTITY_LINK, getModel()); - - entitySimpleLink.setOutputMarkupId(true); - entitySimpleLink.setLabel(Model.of(name)); - - final WebMarkupContainer labelIfCompact = new WebMarkupContainer(ID_SCALAR_IF_COMPACT); - labelIfCompact.add(entitySimpleLink); - - addOrReplace(labelIfCompact); - - return labelIfCompact; - } - - - // First called as a side-effect of {@link #beforeRender()} - @Override - protected FormGroup addComponentForRegular() { - final ScalarModel scalarModel = getModel(); - final String name = scalarModel.getName(); - - entityLink = new EntityLinkSelect2Panel(ComponentType.ENTITY_LINK.getWicketId(), this); - syncWithInput(); - - setOutputMarkupId(true); - entityLink.setOutputMarkupId(true); - entityLink.setLabel(Model.of(name)); - - final FormGroup labelIfRegular = new FormGroup(ID_SCALAR_IF_REGULAR, entityLink); - labelIfRegular.add(entityLink); - - final String describedAs = getModel().getDescribedAs(); - if(describedAs != null) { - labelIfRegular.add(new AttributeModifier("title", Model.of(describedAs))); - } - - final Label scalarName = new Label(ID_SCALAR_NAME, getRendering().getLabelCaption(entityLink)); - labelIfRegular.add(scalarName); - NamedFacet namedFacet = getModel().getFacet(NamedFacet.class); - if (namedFacet != null) { - scalarName.setEscapeModelStrings(namedFacet.escaped()); - } - - // find the links... - final List<LinkAndLabel> entityActions = EntityActionUtil.getEntityActionLinksForAssociation(this.scalarModel, getDeploymentType()); - - addPositioningCssTo(labelIfRegular, entityActions); - - addOrReplace(labelIfRegular); - - addFeedbackTo(labelIfRegular, entityLink); - - // ... add entity links to panel (below and to right) - addEntityActionLinksBelowAndRight(labelIfRegular, entityActions); - - // add semantics - entityLink.setRequired(getModel().isRequired()); - entityLink.add(new IValidator<ObjectAdapter>() { - - private static final long serialVersionUID = 1L; - - @Override - public void validate(final IValidatable<ObjectAdapter> validatable) { - final ObjectAdapter proposedAdapter = validatable.getValue(); - final String reasonIfAny = getModel().validate(proposedAdapter); - if (reasonIfAny != null) { - final ValidationError error = new ValidationError(); - error.setMessage(reasonIfAny); - validatable.error(error); - } - } - }); - - if(getModel().isRequired()) { - labelIfRegular.add(new CssClassAppender("mandatory")); - } - return labelIfRegular; - } - - // ////////////////////////////////////// - - // called from buildGui - @Override - protected void addFormComponentBehavior(Behavior behavior) { - if(select2Field != null) { - select2Field.add(behavior); - } - } - - - // ////////////////////////////////////// - // onBeforeRender* - // ////////////////////////////////////// - - @Override - protected void onBeforeRenderWhenEnabled() { - super.onBeforeRenderWhenEnabled(); - entityLink.setEnabled(true); - syncWithInput(); - } - - @Override - protected void onBeforeRenderWhenViewMode() { - super.onBeforeRenderWhenViewMode(); - entityLink.setEnabled(false); - syncWithInput(); - } - - @Override - protected void onBeforeRenderWhenDisabled(final String disableReason) { - super.onBeforeRenderWhenDisabled(disableReason); - syncWithInput(); - final EntityModel entityLinkModel = (EntityModel) entityLink.getModel(); - entityLinkModel.toViewMode(); - entityLink.setEnabled(false); - entityLink.add(new AttributeModifier("title", Model.of(disableReason))); - } - - - // ////////////////////////////////////// - // syncWithInput - // ////////////////////////////////////// - - - // called from onBeforeRender* - // (was previous called by EntityLinkSelect2Panel in onBeforeRender, this responsibility now moved) - private void syncWithInput() { - final ObjectAdapter adapter = getModel().getPendingElseCurrentAdapter(); - - // syncLinkWithInput - final MarkupContainer componentForRegular = (MarkupContainer) getComponentForRegular(); - if (adapter != null) { - if(componentForRegular != null) { - final EntityModel entityModelForLink = new EntityModel(adapter); - - entityModelForLink.setContextAdapterIfAny(getModel().getContextAdapterIfAny()); - entityModelForLink.setRenderingHint(getModel().getRenderingHint()); - - final ComponentFactory componentFactory = - getComponentFactoryRegistry().findComponentFactory(ComponentType.ENTITY_ICON_AND_TITLE, entityModelForLink); - final Component component = componentFactory.createComponent(entityModelForLink); - - componentForRegular.addOrReplace(component); - - Components.permanentlyHide(componentForRegular, "entityTitleIfNull"); - - } - - - } else { - - if(componentForRegular != null) { - componentForRegular.addOrReplace(new Label("entityTitleIfNull", "(none)")); - //Components.permanentlyHide(componentForRegular, "entityTitleIfNull"); - Components.permanentlyHide(componentForRegular, ID_ENTITY_ICON_TITLE); - } - } - - - // syncLinkWithInputIfAutoCompleteOrChoices - if(isEditableWithEitherAutoCompleteOrChoices()) { - final IModel<ObjectAdapterMemento> model = Util.createModel(getModel().asScalarModelWithPending()); - - if(select2Field == null) { - entityLink.setRequired(getModel().isRequired()); - select2Field = Select2ChoiceUtil.newSelect2Choice(ID_AUTO_COMPLETE, model, getModel()); - setProviderAndCurrAndPending(select2Field, getModel().getActionArgsHint()); - if(!getModel().hasChoices()) { - final Settings settings = select2Field.getSettings(); - final int minLength = getModel().getAutoCompleteMinLength(); - settings.setMinimumInputLength(minLength); - settings.setPlaceholder(getModel().getName()); - } - entityLink.addOrReplace(select2Field); - } else { - // - // the select2Field already exists, so the widget has been rendered before. If it is - // being re-rendered now, it may be because some other property/parameter was invalid. - // when the form was submitted, the selected object (its oid as a string) would have - // been saved as rawInput. If the property/parameter had been valid, then this rawInput - // would be correctly converted and processed by the select2Field's choiceProvider. However, - // an invalid property/parameter means that the webpage is re-rendered in another request, - // and the rawInput can no longer be interpreted. The net result is that the field appears - // with no input. - // - // The fix is therefore (I think) simply to clear any rawInput, so that the select2Field - // renders its state from its model. - // - // see: FormComponent#getInputAsArray() - // see: Select2Choice#renderInitializationScript() - // - select2Field.clearInput(); - } - - if(getComponentForRegular() != null) { - Components.permanentlyHide((MarkupContainer)getComponentForRegular(), ID_ENTITY_ICON_TITLE); - Components.permanentlyHide(componentForRegular, "entityTitleIfNull"); - } - - - - // syncUsability - if(select2Field != null) { - final boolean mutability = entityLink.isEnableAllowed() && !getModel().isViewMode(); - select2Field.setEnabled(mutability); - } - - Components.permanentlyHide(entityLink, "entityLinkIfNull"); - } else { - // this is horrid; adds a label to the id - // should instead be a 'temporary hide' - Components.permanentlyHide(entityLink, ID_AUTO_COMPLETE); - select2Field = null; // this forces recreation next time around - } - - } - - // called by syncWithInput - private void permanentlyHideEntityIconAndTitleIfInRegularMode() { - if(getComponentForRegular() != null) { - Components.permanentlyHide((MarkupContainer)getComponentForRegular(), ID_ENTITY_ICON_TITLE); - } - } - - - // ////////////////////////////////////// - // setProviderAndCurrAndPending - // ////////////////////////////////////// - - // called by syncWithInput, updateChoices - private void setProviderAndCurrAndPending( - final Select2Choice<ObjectAdapterMemento> select2Field, - final ObjectAdapter[] argsIfAvailable) { - if (getModel().hasChoices()) { - - final List<ObjectAdapterMemento> choiceMementos = obtainChoiceMementos(argsIfAvailable); - ObjectAdapterMementoProviderAbstract providerForChoices = providerForChoices(choiceMementos); - - select2Field.setProvider(providerForChoices); - getModel().clearPending(); - - resetIfCurrentNotInChoices(select2Field, choiceMementos); - - } else if(hasParamOrPropertyAutoComplete()) { - select2Field.setProvider(providerForParamOrPropertyAutoComplete()); - getModel().clearPending(); - } else { - select2Field.setProvider(providerForObjectAutoComplete()); - getModel().clearPending(); - } - } - - // called by setProviderAndCurrAndPending - private List<ObjectAdapterMemento> obtainChoiceMementos(final ObjectAdapter[] argsIfAvailable) { - final List<ObjectAdapter> choices = Lists.newArrayList(); - if(getModel().hasChoices()) { - choices.addAll(getModel().getChoices(argsIfAvailable)); - } - // take a copy otherwise is only lazily evaluated - return Lists.newArrayList(Lists.transform(choices, ObjectAdapterMemento.Functions.fromAdapter())); - } - - // called by setProviderAndCurrAndPending - private void resetIfCurrentNotInChoices(final Select2Choice<ObjectAdapterMemento> select2Field, final List<ObjectAdapterMemento> choiceMementos) { - final ObjectAdapterMemento curr = select2Field.getModelObject(); - if(curr == null) { - select2Field.getModel().setObject(null); - getModel().setObject(null); - return; - } - - if(!curr.containedIn(choiceMementos)) { - if(!choiceMementos.isEmpty()) { - final ObjectAdapterMemento newAdapterMemento = choiceMementos.get(0); - select2Field.getModel().setObject(newAdapterMemento); - getModel().setObject(newAdapterMemento.getObjectAdapter(ConcurrencyChecking.NO_CHECK)); - } else { - select2Field.getModel().setObject(null); - getModel().setObject(null); - } - } - } - - // called by setProviderAndCurrAndPending - private ChoiceProvider<ObjectAdapterMemento> providerForObjectAutoComplete() { - return new ObjectAdapterMementoProviderAbstract(getModel(), wicketViewerSettings) { - - private static final long serialVersionUID = 1L; - - @Override - protected List<ObjectAdapterMemento> obtainMementos(String term) { - final ObjectSpecification typeOfSpecification = getScalarModel().getTypeOfSpecification(); - final AutoCompleteFacet autoCompleteFacet = typeOfSpecification.getFacet(AutoCompleteFacet.class); - final List<ObjectAdapter> results = autoCompleteFacet.execute(term); - return Lists.transform(results, ObjectAdapterMemento.Functions.fromAdapter()); - } - }; - } - - // called by setProviderAndCurrAndPending - private ChoiceProvider<ObjectAdapterMemento> providerForParamOrPropertyAutoComplete() { - return new ObjectAdapterMementoProviderAbstract(getModel(), wicketViewerSettings) { - - private static final long serialVersionUID = 1L; - - @Override - protected List<ObjectAdapterMemento> obtainMementos(String term) { - final List<ObjectAdapter> autoCompleteChoices = Lists.newArrayList(); - if(getScalarModel().hasAutoComplete()) { - autoCompleteChoices.addAll(getScalarModel().getAutoComplete(term)); - } - // take a copy otherwise is only lazily evaluated - return Lists.newArrayList(Lists.transform(autoCompleteChoices, ObjectAdapterMemento.Functions.fromAdapter())); - } - - }; - } - - // called by setProviderAndCurrAndPending - private ObjectAdapterMementoProviderAbstract providerForChoices(final List<ObjectAdapterMemento> choiceMementos) { - return new ObjectAdapterMementoProviderAbstract(getModel(), wicketViewerSettings) { - private static final long serialVersionUID = 1L; - @Override - protected List<ObjectAdapterMemento> obtainMementos(String term) { - return obtainMementos(term, choiceMementos); - } - }; - } - - - // ////////////////////////////////////// - // getInput, convertInput - // ////////////////////////////////////// - - // called by EntityLinkSelect2Panel - String getInput() { - final ObjectAdapter pendingElseCurrentAdapter = getModel().getPendingElseCurrentAdapter(); - return pendingElseCurrentAdapter != null? pendingElseCurrentAdapter.titleString(null): "(no object)"; - } - - // ////////////////////////////////////// - - // called by EntityLinkSelect2Panel - void convertInput() { - if(isEditableWithEitherAutoCompleteOrChoices()) { - - // flush changes to pending - ObjectAdapterMemento convertedInput = select2Field.getConvertedInput(); - - getModel().setPending(convertedInput); - if(select2Field != null) { - select2Field.getModel().setObject(convertedInput); - } - - final ObjectAdapter adapter = convertedInput!=null?convertedInput.getObjectAdapter(ConcurrencyChecking.NO_CHECK):null; - getModel().setObject(adapter); - } - - final ObjectAdapter pendingAdapter = getModel().getPendingAdapter(); - entityLink.setConvertedInput(pendingAdapter); - } - - // ////////////////////////////////////// - // updateChoices - // ////////////////////////////////////// - - /** - * Hook method to refresh choices when changing. - * - * <p> - * called from onUpdate callback - */ - @Override - public boolean updateChoices(ObjectAdapter[] argsIfAvailable) { - if(select2Field != null) { - setProviderAndCurrAndPending(select2Field, argsIfAvailable); - return true; - } else { - return false; - } - } - - - // ////////////////////////////////////// - // helpers querying model state - // ////////////////////////////////////// - - // called from convertInput, syncWithInput - private boolean isEditableWithEitherAutoCompleteOrChoices() { - if(getModel().getRenderingHint().isInTable()) { - return false; - } - // doesn't apply if not editable, either - if(getModel().isViewMode()) { - return false; - } - return getModel().hasChoices() || hasParamOrPropertyAutoComplete() || hasObjectAutoComplete(); - } - - // called by isEditableWithEitherAutoCompleteOrChoices, also syncProviderAndCurrAndPending - private boolean hasParamOrPropertyAutoComplete() { - return getModel().hasAutoComplete(); - } - - // called by isEditableWithEitherAutoCompleteOrChoices - private boolean hasObjectAutoComplete() { - final ObjectSpecification typeOfSpecification = getModel().getTypeOfSpecification(); - final AutoCompleteFacet autoCompleteFacet = - (typeOfSpecification != null)? typeOfSpecification.getFacet(AutoCompleteFacet.class):null; - return autoCompleteFacet != null; - } - - @Inject - private WicketViewerSettings wicketViewerSettings; - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanelFactory.java deleted file mode 100644 index 75efb99..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/reference/ReferencePanelFactory.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.reference; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; - -import org.apache.isis.core.metamodel.facets.object.value.ValueFacet; -import org.apache.isis.core.metamodel.spec.ObjectSpecification; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract; -import org.apache.isis.viewer.wicket.ui.ComponentType; - -/** - * {@link ComponentFactory} for {@link ReferencePanel}. - */ -public class ReferencePanelFactory extends ComponentFactoryAbstract { - - private static final long serialVersionUID = 1L; - - public ReferencePanelFactory() { - super(ComponentType.SCALAR_NAME_AND_VALUE, ReferencePanel.class); - } - - @Override - public ApplicationAdvice appliesTo(final IModel<?> model) { - if (!(model instanceof ScalarModel)) { - return ApplicationAdvice.DOES_NOT_APPLY; - } - final ScalarModel scalarModel = (ScalarModel) model; - final ObjectSpecification specification = scalarModel.getTypeOfSpecification(); - return appliesIf(!specification.containsFacet(ValueFacet.class)); - } - - @Override - public Component createComponent(final String id, final IModel<?> model) { - final ScalarModel scalarModel = (ScalarModel) model; - return new ReferencePanel(id, scalarModel); - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/MultiLineStringPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/MultiLineStringPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/MultiLineStringPanel.java deleted file mode 100644 index 0bf8198..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/MultiLineStringPanel.java +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.string; - -import org.apache.wicket.AttributeModifier; -import org.apache.wicket.Component; -import org.apache.wicket.markup.html.form.AbstractTextComponent; -import org.apache.wicket.markup.html.form.TextArea; -import org.apache.wicket.markup.html.panel.Fragment; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; - -import org.apache.isis.core.metamodel.facets.SingleIntValueFacet; -import org.apache.isis.core.metamodel.facets.objectvalue.maxlen.MaxLengthFacet; -import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacet; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract; - -/** - * Panel for rendering MultiLine scalars of type String - */ -public class MultiLineStringPanel extends ScalarPanelTextFieldParseableAbstract { - - private static final long serialVersionUID = 1L; - - public MultiLineStringPanel(final String id, final ScalarModel scalarModel) { - super(id, ID_SCALAR_VALUE, scalarModel); - } - - @Override - protected AbstractTextComponent<String> createTextFieldForRegular() { - final TextArea<String> textField = new TextArea<String>(idTextField, new Model<String>() { - private static final long serialVersionUID = 1L; - - @Override - public String getObject() { - return getModel().getObjectAsString(); - } - - @Override - public void setObject(final String object) { - if (object == null) { - getModel().setObject(null); - } else { - getModel().setObjectAsString(object); - } - } - }); - - final MultiLineFacet multiLineFacet = getModel().getFacet(MultiLineFacet.class); - setAttribute(textField, "rows", multiLineFacet.numberOfLines()); - - - final Integer maxLength = getValueOf(getModel(), MaxLengthFacet.class); - if(maxLength != null) { - // in conjunction with javascript in jquery.isis.wicket.viewer.js - // see http://stackoverflow.com/questions/4459610/set-maxlength-in-html-textarea - setAttribute(textField, "maxlength", maxLength); - } - - return textField; - } - - @Override - protected Fragment createTextFieldFragment(String id) { - return new Fragment(id, "textarea", MultiLineStringPanel.this); - } - - @Override - protected IModel<String> getScalarPanelType() { - return Model.of("multiLineStringPanel"); - } - - private Component setAttribute(final TextArea<String> textField, final String attributeName, final int i) { - return textField.add(AttributeModifier.replace(attributeName, ""+i)); - } - - private static Integer getValueOf(ScalarModel model, Class<? extends SingleIntValueFacet> facetType) { - final SingleIntValueFacet facet = model.getFacet(facetType); - return facet != null ? facet.value() : null; - } - - - public int getNumberOfLines(final ScalarModel scalarModel) { - final MultiLineFacet multiLineFacet = scalarModel.getFacet(MultiLineFacet.class); - int numberOfLines = 1; - - if (multiLineFacet != null) { - numberOfLines = multiLineFacet.numberOfLines(); - } - - return numberOfLines; - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanel.java deleted file mode 100644 index b832a17..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanel.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.string; - -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract; - -/** - * Panel for rendering scalars of type {@link String}. - */ -public class StringPanel extends ScalarPanelTextFieldParseableAbstract { - - private static final long serialVersionUID = 1L; - private static final String ID_SCALAR_VALUE = "scalarValue"; - - - public StringPanel(final String id, final ScalarModel scalarModel) { - super(id, ID_SCALAR_VALUE, scalarModel); - } - - @Override - protected IModel<String> getScalarPanelType() { - return Model.of("stringPanel"); - } - - @Override - protected void addSemantics() { - super.addSemantics(); - } - - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanelFactory.java deleted file mode 100644 index e8345f2..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/string/StringPanelFactory.java +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.string; - -import org.apache.wicket.Component; - -import org.apache.isis.core.metamodel.facets.objectvalue.multiline.MultiLineFacet; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract; - -public class StringPanelFactory extends ComponentFactoryScalarAbstract { - - private static final long serialVersionUID = 1L; - - public StringPanelFactory() { - super( - StringPanel.class, - String.class); - } - - @Override - public Component createComponent(final String id, final ScalarModel scalarModel) { - final MultiLineFacet multiLineFacet = scalarModel.getFacet(MultiLineFacet.class); - if (multiLineFacet != null && !multiLineFacet.isNoop()) { - return new MultiLineStringPanel(id, scalarModel); - } else { - return new StringPanel(id, scalarModel); - } - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanel.java deleted file mode 100644 index fd3641a..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanel.java +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.value; - -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; -import org.apache.isis.applib.annotation.Value; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelAbstract; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelTextFieldParseableAbstract; - -/** - * Panel for rendering any value types that do not have their own custom - * {@link ScalarPanelAbstract panel} to render them. - * - * <p> - * This is a fallback panel; values are expected to be {@link Parser parseable} - * (typically through the Isis' {@link Value} annotation. - */ -public class ValuePanel extends ScalarPanelTextFieldParseableAbstract { - - private static final long serialVersionUID = 1L; - private static final String ID_SCALAR_VALUE = "scalarValue"; - - public ValuePanel(final String id, final ScalarModel scalarModel) { - super(id, ID_SCALAR_VALUE, scalarModel); - } - - @Override - protected void addSemantics() { - super.addSemantics(); - } - - @Override - protected IModel<String> getScalarPanelType() { - return Model.of("valuePanel"); - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanelFactory.java deleted file mode 100644 index 85ba70f..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/scalars/value/ValuePanelFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.scalars.value; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; - -import org.apache.isis.core.metamodel.facets.object.value.ValueFacet; -import org.apache.isis.viewer.wicket.model.models.ScalarModel; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.components.scalars.ComponentFactoryScalarAbstract; - -/** - * {@link ComponentFactory} for the {@link ValuePanel}. - */ -public class ValuePanelFactory extends ComponentFactoryScalarAbstract { - - private static final long serialVersionUID = 1L; - - public ValuePanelFactory() { - super(ValuePanel.class); // not asking the supertype to validate types, so no value types need be provided. - } - - @Override - public ApplicationAdvice appliesTo(final IModel<?> model) { - if (!(model instanceof ScalarModel)) { - return ApplicationAdvice.DOES_NOT_APPLY; - } - final ScalarModel scalarModel = (ScalarModel) model; - final ValueFacet valueFacet = scalarModel.getTypeOfSpecification().getFacet(ValueFacet.class); - if(valueFacet == null) { - return ApplicationAdvice.DOES_NOT_APPLY; - } - return appliesIf(!scalarModel.hasChoices()); - } - - @Override - public Component createComponent(final String id, final ScalarModel scalarModel) { - return new ValuePanel(id, scalarModel); - } - - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.html deleted file mode 100644 index a76fcfe..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.html +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <body> - <wicket:panel> - - <div wicket:id="actionPromptModalWindow"></div> - <div class="standaloneCollectionPanel actionComponentType myBlockContainer panel panel-default"> - <div class="iconAndTitle panel-heading actionPanelHeaderNew"> - <span wicket:id="actionName" class="actionName panel-title">[action name]</span> - - <div class="btn-group"> - <div wicket:id="additionalLinks"></div> - </div> - - <div class="pull-right btn-group selectorDropdown"> - <span wicket:id="selectorDropdown"/> - </div> - </div> - - <div wicket:id="collectionContents" class="panel-body"></div> - </div> - - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.java deleted file mode 100644 index 101f26e..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanel.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.standalonecollection; - -import java.util.List; -import com.google.common.base.Function; -import com.google.common.collect.Lists; -import org.apache.wicket.Component; -import org.apache.wicket.ajax.AjaxRequestTarget; -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.model.Model; -import org.apache.isis.core.metamodel.adapter.ObjectAdapter; -import org.apache.isis.core.metamodel.spec.feature.ObjectAction; -import org.apache.isis.viewer.wicket.model.common.OnSelectionHandler; -import org.apache.isis.viewer.wicket.model.links.LinkAndLabel; -import org.apache.isis.viewer.wicket.model.models.ActionModel; -import org.apache.isis.viewer.wicket.model.models.ActionPromptProvider; -import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentType; -import org.apache.isis.viewer.wicket.ui.app.registry.ComponentFactoryRegistry; -import org.apache.isis.viewer.wicket.ui.components.actionprompt.ActionPromptModalWindow; -import org.apache.isis.viewer.wicket.ui.components.actionmenu.entityactions.AdditionalLinksPanel; -import org.apache.isis.viewer.wicket.ui.components.collection.bulk.BulkActionsHelper; -import org.apache.isis.viewer.wicket.ui.components.collection.bulk.BulkActionsLinkFactory; -import org.apache.isis.viewer.wicket.ui.components.collection.bulk.BulkActionsProvider; -import org.apache.isis.viewer.wicket.ui.components.collection.count.CollectionCountProvider; -import org.apache.isis.viewer.wicket.ui.components.collection.selector.CollectionSelectorHelper; -import org.apache.isis.viewer.wicket.ui.components.collection.selector.CollectionSelectorPanel; -import org.apache.isis.viewer.wicket.ui.components.collection.selector.CollectionSelectorProvider; -import org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn; -import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract; - -public class StandaloneCollectionPanel extends PanelAbstract<EntityCollectionModel> - implements CollectionCountProvider, CollectionSelectorProvider, BulkActionsProvider, ActionPromptProvider { - - private static final long serialVersionUID = 1L; - - private static final String ID_ACTION_NAME = "actionName"; - - private static final String ID_ACTION_PROMPT_MODAL_WINDOW = "actionPromptModalWindow"; - private static final String ID_ADDITIONAL_LINKS = "additionalLinks"; - private static final String ID_ADDITIONAL_LINK = "additionalLink"; - - private static final String ID_SELECTOR_DROPDOWN = "selectorDropdown"; - - private final ActionPromptModalWindow actionPromptModalWindow; - private final CollectionSelectorPanel selectorDropdownPanel; - private final BulkActionsHelper bulkActionsHelper; - - private boolean additionalLinksAdded; - - /** - * note that the bulk actions components are added in {@link #configureBulkActions(org.apache.isis.viewer.wicket.ui.components.collectioncontents.ajaxtable.columns.ObjectAdapterToggleboxColumn)}. - */ - public StandaloneCollectionPanel(final String id, final EntityCollectionModel entityCollectionModel) { - super(id, entityCollectionModel); - - ActionModel actionModel = entityCollectionModel.getActionModelHint(); - ObjectAction action = actionModel.getActionMemento().getAction(); - addOrReplace(new Label(StandaloneCollectionPanel.ID_ACTION_NAME, Model.of(action.getName()))); - - // action prompt - this.actionPromptModalWindow = ActionPromptModalWindow.newModalWindow(ID_ACTION_PROMPT_MODAL_WINDOW); - addOrReplace(actionPromptModalWindow); - - // selector - final CollectionSelectorHelper selectorHelper = new CollectionSelectorHelper(entityCollectionModel, getComponentFactoryRegistry()); - - final List<ComponentFactory> componentFactories = selectorHelper.getComponentFactories(); - - if (componentFactories.size() <= 1) { - permanentlyHide(ID_SELECTOR_DROPDOWN); - this.selectorDropdownPanel = null; - } else { - CollectionSelectorPanel selectorDropdownPanel = new CollectionSelectorPanel(ID_SELECTOR_DROPDOWN, entityCollectionModel); - - final Model<ComponentFactory> componentFactoryModel = new Model<>(); - - final int selected = selectorHelper.honourViewHintElseDefault(selectorDropdownPanel); - - ComponentFactory selectedComponentFactory = componentFactories.get(selected); - componentFactoryModel.setObject(selectedComponentFactory); - - this.setOutputMarkupId(true); - addOrReplace(selectorDropdownPanel); - - this.selectorDropdownPanel = selectorDropdownPanel; - } - - final ComponentFactoryRegistry componentFactoryRegistry = getComponentFactoryRegistry(); - componentFactoryRegistry.addOrReplaceComponent(this, ComponentType.COLLECTION_CONTENTS, entityCollectionModel); - - bulkActionsHelper = new BulkActionsHelper(entityCollectionModel); - } - - //region > ActionPromptModalWindowProvider - - public ActionPromptModalWindow getActionPrompt() { - return ActionPromptModalWindow.getActionPromptModalWindowIfEnabled(actionPromptModalWindow); - } - - //endregion - - //region > BulkActionsProvider - - @Override - public ObjectAdapterToggleboxColumn createToggleboxColumn() { - - final List<ObjectAction> bulkActions = bulkActionsHelper.getBulkActions(); - - final EntityCollectionModel entityCollectionModel = getModel(); - if(bulkActions.isEmpty() || entityCollectionModel.isParented()) { - return null; - } - - final ObjectAdapterToggleboxColumn toggleboxColumn = new ObjectAdapterToggleboxColumn(); - final OnSelectionHandler handler = new OnSelectionHandler() { - - private static final long serialVersionUID = 1L; - - @Override - public void onSelected( - final Component context, - final ObjectAdapter selectedAdapter, - final AjaxRequestTarget ajaxRequestTarget) { - getModel().toggleSelectionOn(selectedAdapter); - } - - }; - toggleboxColumn.setOnSelectionHandler(handler); - - return toggleboxColumn; - } - - @Override - public void configureBulkActions(final ObjectAdapterToggleboxColumn toggleboxColumn) { - - if(additionalLinksAdded) { - return; - } - final BulkActionsLinkFactory linkFactory = - new BulkActionsLinkFactory(getModel(), toggleboxColumn); - - final List<ObjectAction> bulkActions = bulkActionsHelper.getBulkActions(); - - List<LinkAndLabel> links = Lists.transform(bulkActions, new Function<ObjectAction, LinkAndLabel>(){ - @Override - public LinkAndLabel apply(ObjectAction objectAction) { - return linkFactory.newLink(null, objectAction, ID_ADDITIONAL_LINK); - } - }); - - AdditionalLinksPanel.addAdditionalLinks(this, ID_ADDITIONAL_LINKS, links, AdditionalLinksPanel.Style.INLINE_LIST); - additionalLinksAdded = true; - - } - - //endregion - - - - - //region > CollectionSelectorProvider - - @Override - public CollectionSelectorPanel getSelectorDropdownPanel() { - return selectorDropdownPanel; - } - - //endregion - - //region > CollectionCountProvider - - @Override - public Integer getCount() { - final EntityCollectionModel model = getModel(); - return model.getCount(); - } - - //endregion - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanelFactory.java deleted file mode 100644 index b85c4e1..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/standalonecollection/StandaloneCollectionPanelFactory.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.standalonecollection; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; - -import org.apache.isis.viewer.wicket.model.models.ActionModel; -import org.apache.isis.viewer.wicket.model.models.EntityCollectionModel; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract; -import org.apache.isis.viewer.wicket.ui.ComponentType; - -/** - * {@link ComponentFactory} for {@link StandaloneCollectionPanel}. - */ -public class StandaloneCollectionPanelFactory extends ComponentFactoryAbstract { - - private static final long serialVersionUID = 1L; - - public StandaloneCollectionPanelFactory() { - super(ComponentType.STANDALONE_COLLECTION, StandaloneCollectionPanel.class); - } - - @Override - public ApplicationAdvice appliesTo(final IModel<?> model) { - return appliesIf(model instanceof EntityCollectionModel); - } - - @Override - public Component createComponent(final String id, final IModel<?> model) { - final EntityCollectionModel actionModel = (EntityCollectionModel) model; - return new StandaloneCollectionPanel(id, actionModel); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.html deleted file mode 100644 index 76d1b64..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.html +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <body> - <wicket:panel> - <div class="unknownModelPanel"> - <label wicket:id="unknown">[Unknown model]</label> - </div> - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.java deleted file mode 100644 index 0d3fb4a..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanel.java +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.unknown; - -import org.apache.wicket.markup.html.basic.Label; -import org.apache.wicket.model.IModel; -import org.apache.wicket.model.Model; - -import org.apache.isis.core.metamodel.adapter.ObjectAdapter; -import org.apache.isis.viewer.wicket.model.models.EntityModel; -import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract; - -public class UnknownModelPanel extends PanelAbstract<IModel<?>> { - - private static final long serialVersionUID = 1L; - - public UnknownModelPanel(final String id, IModel<?> model) { - super(id, model); - buildGui(id); - } - - private void buildGui(final String id) { - addOrReplace( - new Label("unknown", Model.of(buildMessage()))); - } - - private String buildMessage() { - StringBuilder buf = new StringBuilder(); - buf.append("??? "); - if(getModel() != null) { - buildMessageForModel(buf, getModel()); - } else { - buf.append("model is NULL"); - } - //buf.append(getModel().toString()); - return buf.toString(); - } - - private void buildMessageForModel(StringBuilder buf, IModel<?> model) { - buf.append(model.getClass().getSimpleName()).append(" "); - if(model instanceof EntityModel) { - EntityModel entityModel = (EntityModel) model; - ObjectAdapter objectAdapter = entityModel.getObject(); - if(objectAdapter != null) { - buf.append("objectAdapter oid: " + objectAdapter.getOid()); - } else { - buf.append("objectAdapter is NULL"); - } - } - - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanelFactory.java deleted file mode 100644 index 69b5f58..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/unknown/UnknownModelPanelFactory.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.unknown; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; -import org.apache.wicket.request.resource.CssResourceReference; - -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentType; -import org.apache.isis.viewer.wicket.ui.panels.PanelUtil; - -public class UnknownModelPanelFactory implements ComponentFactory { - - private static final long serialVersionUID = 1L; - - @Override - public ApplicationAdvice appliesTo(ComponentType componentType, IModel<?> model) { - return ApplicationAdvice.APPLIES; - } - - @Override - public Component createComponent(final String id, final IModel<?> model) { - return new UnknownModelPanel(id, model); - } - - @Override - public ComponentType getComponentType() { - return ComponentType.UNKNOWN; - } - - @Override - public Component createComponent(IModel<?> model) { - return createComponent("unknown", model); - } - - @Override - public String getName() { - return getClass().getSimpleName(); - } - - @Override - public CssResourceReference getCssResourceReference() { - return PanelUtil.cssResourceReferenceFor(UnknownModelPanel.class); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.html deleted file mode 100644 index 2a78e64..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.html +++ /dev/null @@ -1,32 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <body> - <wicket:panel> - <div class="standaloneValuePanel standaloneValueComponentType"> - <span wicket:id="standaloneValue" class="standaloneValue">[value as text]</span> - </div> - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.java deleted file mode 100644 index 80e12f1..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanel.java +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.value; - -import org.apache.wicket.markup.html.basic.Label; - -import org.apache.isis.core.metamodel.adapter.ObjectAdapter; -import org.apache.isis.viewer.wicket.model.models.ValueModel; -import org.apache.isis.viewer.wicket.ui.components.scalars.ScalarPanelAbstract; -import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract; - -/** - * Panel for rendering any value types that do not have their own custom - * {@link ScalarPanelAbstract panel} to render them. - */ -public class StandaloneValuePanel extends PanelAbstract<ValueModel> { - - private static final long serialVersionUID = 1L; - private static final String ID_STANDALONE_VALUE = "standaloneValue"; - - public StandaloneValuePanel(final String id, final ValueModel valueModel) { - super(id, valueModel); - final ObjectAdapter objectAdapter = getModel().getObject(); - - final String label = objectAdapter.titleString(null); - add(new Label(ID_STANDALONE_VALUE, label)); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanelFactory.java deleted file mode 100644 index 6f4404b..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/value/StandaloneValuePanelFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.value; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; - -import org.apache.isis.viewer.wicket.model.models.ValueModel; -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract; -import org.apache.isis.viewer.wicket.ui.ComponentType; - -/** - * {@link ComponentFactory} for rendering standalone values.. - */ -public class StandaloneValuePanelFactory extends ComponentFactoryAbstract { - - private static final long serialVersionUID = 1L; - - public StandaloneValuePanelFactory() { - super(ComponentType.VALUE, StandaloneValuePanel.class); - } - - @Override - public ApplicationAdvice appliesTo(final IModel<?> model) { - return ApplicationAdvice.appliesIf(model instanceof ValueModel && ((ValueModel)model).getObject() != null); - } - - @Override - public Component createComponent(final String id, final IModel<?> model) { - ValueModel valueModel = (ValueModel) model; - return new StandaloneValuePanel(id, valueModel); - } -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.html deleted file mode 100644 index bfe4192..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.html +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" - xmlns:wicket="http://wicket.apache.org/dtds.data/wicket-xhtml1.4-strict.dtd" - xml:lang="en" - lang="en"> - <head></head> - <body> - <wicket:panel> - <div class="voidReturnPanel voidReturnComponentType"> - <span>No results</span> - </div> - </wicket:panel> - </body> -</html> http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.java deleted file mode 100644 index b186254..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanel.java +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.voidreturn; - -import org.apache.wicket.model.IModel; - -import org.apache.isis.viewer.wicket.ui.panels.PanelAbstract; - -public class VoidReturnPanel extends PanelAbstract<IModel<?>> { - - private static final long serialVersionUID = 1L; - - public VoidReturnPanel(final String id) { - super(id); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanelFactory.java ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanelFactory.java b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanelFactory.java deleted file mode 100644 index 4af7e0f..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/voidreturn/VoidReturnPanelFactory.java +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.isis.viewer.wicket.ui.components.voidreturn; - -import org.apache.wicket.Component; -import org.apache.wicket.model.IModel; - -import org.apache.isis.viewer.wicket.ui.ComponentFactory; -import org.apache.isis.viewer.wicket.ui.ComponentFactoryAbstract; -import org.apache.isis.viewer.wicket.ui.ComponentType; - -/** - * {@link ComponentFactory} to represent an action that returns void. - */ -public class VoidReturnPanelFactory extends ComponentFactoryAbstract { - - private static final long serialVersionUID = 1L; - - public VoidReturnPanelFactory() { - super(ComponentType.VOID_RETURN, VoidReturnPanel.class); - } - - @Override - public ApplicationAdvice appliesTo(final IModel<?> model) { - return ApplicationAdvice.APPLIES; - } - - @Override - public Component createComponent(final String id, final IModel<?> model) { - return new VoidReturnPanel(id); - } - -} http://git-wip-us.apache.org/repos/asf/isis/blob/d84c6609/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/welcome/WelcomePanel.html ---------------------------------------------------------------------- diff --git a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/welcome/WelcomePanel.html b/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/welcome/WelcomePanel.html deleted file mode 100644 index f137d2f..0000000 --- a/component/viewer/wicket/ui/src/main/java/org/apache/isis/viewer/wicket/ui/components/welcome/WelcomePanel.html +++ /dev/null @@ -1,29 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!-- - Licensed to the Apache Software Foundation (ASF) under one - or more contributor license agreements. See the NOTICE file - distributed with this work for additional information - regarding copyright ownership. The ASF licenses this file - to you under the Apache License, Version 2.0 (the - "License"); you may not use this file except in compliance - with the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, - software distributed under the License is distributed on an - "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - KIND, either express or implied. See the License for the - specific language governing permissions and limitations - under the License. ---> -<wicket:panel xmlns:wicket="http://wicket.apache.org"> - <div class="page-header container"> - <div class="row"> - <wicket:remove>TODO do something about DISABLED-** classes</wicket:remove> - <div class="col-xs-8 col-md-7 col-sm-6 DISABLED-welcomePanel DISABLED-welcomeComponentType"> - <div wicket:id="message" id="message" class="lead">A calm blue sky</div> - </div> - </div> - </div> -</wicket:panel>
