You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2016/05/21 07:10:18 UTC
[17/56] [abbrv] [partial] isis git commit: ISIS-1335: deleting the
mothballed directory.
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/NodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/NodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/NodeSpecification.java
deleted file mode 100644
index dfe14ee..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/NodeSpecification.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.dnd.tree;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.viewer.basic.NullFocusManager;
-
-abstract class NodeSpecification implements ViewSpecification {
- public static final int CAN_OPEN = 1;
- public static final int CANT_OPEN = 2;
- public static final int UNKNOWN = 0;
- private ViewSpecification replacementNodeSpecification;
-
- public abstract int canOpen(final Content content);
-
- protected abstract View createNodeView(final Content content, Axes axes);
-
- @Override
- public final View createView(final Content content, final Axes axes, final int sequence) {
- final View view = createNodeView(content, axes);
- final TreeNodeBorder newView = new TreeNodeBorder(view, replacementNodeSpecification);
- newView.setFocusManager(new NullFocusManager());
-
- return newView;
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return false;
- }
-
- @Override
- public boolean isReplaceable() {
- return false;
- }
-
- @Override
- public boolean isResizeable() {
- return false;
- }
-
- @Override
- public boolean isSubView() {
- return true;
- }
-
- final void setReplacementNodeSpecification(final ViewSpecification replacementNodeSpecification) {
- this.replacementNodeSpecification = replacementNodeSpecification;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenCollectionNodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenCollectionNodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenCollectionNodeSpecification.java
deleted file mode 100644
index ddd8af2..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenCollectionNodeSpecification.java
+++ /dev/null
@@ -1,83 +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.dnd.tree;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacet;
-import org.apache.isis.core.metamodel.facets.collections.modify.CollectionFacetUtils;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.CollectionElementBuilder;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-
-/**
- * Specification for a tree node that will display an open collection as a root
- * node or within an object.
- *
- * @see org.apache.isis.viewer.dnd.tree.ClosedCollectionNodeSpecification for
- * displaying a closed collection within an object.
- */
-public class OpenCollectionNodeSpecification extends CompositeNodeSpecification {
- /**
- * A collection tree can only be displayed for a collection that has
- * elements.
- */
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- final ObjectAdapter collection = requirement.getAdapter();
- if (collection == null) {
- return false;
- } else {
- final CollectionFacet facet = CollectionFacetUtils.getCollectionFacetFromSpec(collection);
- return facet != null && facet.size(collection) > 0;
- }
- }
-
- public OpenCollectionNodeSpecification() {
- builder = new CollectionElementBuilder(this);
- }
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- @Override
- public boolean isOpen() {
- return true;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-
- @Override
- public int canOpen(final Content content) {
- return CAN_OPEN;
- }
-
- @Override
- public String getName() {
- return "Collection tree node - open";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenObjectNodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenObjectNodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenObjectNodeSpecification.java
deleted file mode 100644
index 43e3a71..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/OpenObjectNodeSpecification.java
+++ /dev/null
@@ -1,109 +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.dnd.tree;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.feature.Contributed;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.SubviewDecorator;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.border.SelectObjectBorder;
-import org.apache.isis.viewer.dnd.view.composite.ObjectFieldBuilder;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-
-/**
- * Specification for a tree node that will display an open object as a root node
- * or within an object.
- *
- * @see org.apache.isis.viewer.dnd.tree.ClosedObjectNodeSpecification for
- * displaying a closed collection within an object.
- */
-public class OpenObjectNodeSpecification extends CompositeNodeSpecification {
-
- private final SubviewDecorator decorator = new SelectObjectBorder.Factory();
-
- // REVIEW: should provide this rendering context, rather than hardcoding.
- // the net effect currently is that class members annotated with
- // @Hidden(where=Where.ANYWHERE) or @Disabled(where=Where.ANYWHERE) will indeed
- // be hidden/disabled, but will be visible/enabled (perhaps incorrectly)
- // for any other value for Where
- private final Where where = Where.ANYWHERE;
-
- public OpenObjectNodeSpecification() {
- builder = new ObjectFieldBuilder(this);
- }
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- /**
- * This is only used to control root nodes. Therefore a object tree can only
- * be displayed for an object with fields that are collections.
- */
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- if (requirement.isObject() && requirement.hasReference()) {
- final ObjectAdapter object = requirement.getAdapter();
- final List<ObjectAssociation> fields = object.getSpecification().getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(IsisContext.getAuthenticationSession(), object, where));
- for (int i = 0; i < fields.size(); i++) {
- if (fields.get(i).isOneToManyAssociation()) {
- return true;
- }
- }
- }
-
- return false;
- }
-
- @Override
- protected View createNodeView(final Content content, final Axes axes) {
- return decorator.decorate(axes, super.createNodeView(content, axes));
- }
-
- @Override
- public int canOpen(final Content content) {
- return CAN_OPEN;
- }
-
- @Override
- public boolean isOpen() {
- return true;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-
- @Override
- public String getName() {
- return "Object tree node - open";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeDisplayRules.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeDisplayRules.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeDisplayRules.java
deleted file mode 100644
index bc5e938..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeDisplayRules.java
+++ /dev/null
@@ -1,93 +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.dnd.tree;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Allow;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.facets.object.bounded.ChoicesFacetUtils;
-import org.apache.isis.core.metamodel.spec.ActionType;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.view.UserAction;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.Workspace;
-
-public class TreeDisplayRules {
- private static boolean showCollectionsOnly = false;
-
- private TreeDisplayRules() {
- }
-
- public static void menuOptions(final UserActionSet options) {
- // TODO fix and remove following line
- if (true) {
- return;
- }
-
- final UserAction option = new UserAction() {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- showCollectionsOnly = !showCollectionsOnly;
- }
-
- @Override
- public String getName(final View view) {
- return showCollectionsOnly ? "Show collections only" : "Show all references";
- }
-
- @Override
- public Consent disabled(final View view) {
- return Allow.DEFAULT;
- }
-
- @Override
- public String getDescription(final View view) {
- return "This option makes the system only show collections within the trees, and not single elements";
- }
-
- @Override
- public ActionType getType() {
- return ActionType.USER;
- }
-
- @Override
- public String getHelp(final View view) {
- return "";
- }
- };
- options.add(option);
- }
-
- public static boolean isCollectionsOnly() {
- return showCollectionsOnly;
- }
-
- private static boolean canDisplay(final ObjectAdapter object) {
- // TODO: rather than looking for the ChoicesFacet on the type,
- // should look for the appropriate PropertyChoicesFacet, ActionParameterChoicesFacet or
- // PropertyAutoCompleteFacet or ActionParameterAutoCompleteFacet
- final boolean lookupView = object != null && ChoicesFacetUtils.hasChoices(object.getSpecification());
- final boolean showNonCollections = !TreeDisplayRules.isCollectionsOnly();
- final boolean objectView = object instanceof ObjectAdapter && showNonCollections;
- final boolean collectionView = object.getSpecification().isParentedOrFreeCollection();
- return (objectView || collectionView) && !lookupView;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeNodeBorder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeNodeBorder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeNodeBorder.java
deleted file mode 100644
index 413a86b..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeNodeBorder.java
+++ /dev/null
@@ -1,353 +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.dnd.tree;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.metamodel.spec.feature.OneToManyAssociation;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.viewer.dnd.drawing.Bounds;
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.Color;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Offset;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.drawing.Text;
-import org.apache.isis.viewer.dnd.interaction.ViewDragImpl;
-import org.apache.isis.viewer.dnd.view.Click;
-import org.apache.isis.viewer.dnd.view.DragEvent;
-import org.apache.isis.viewer.dnd.view.DragStart;
-import org.apache.isis.viewer.dnd.view.ObjectContent;
-import org.apache.isis.viewer.dnd.view.Placement;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewAreaType;
-import org.apache.isis.viewer.dnd.view.ViewConstants;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.base.AbstractBorder;
-import org.apache.isis.viewer.dnd.view.base.DragViewOutline;
-import org.apache.isis.viewer.dnd.view.base.IconGraphic;
-import org.apache.isis.viewer.dnd.view.collection.CollectionContent;
-import org.apache.isis.viewer.dnd.view.collection.CollectionElement;
-import org.apache.isis.viewer.dnd.view.content.FieldContent;
-import org.apache.isis.viewer.dnd.view.field.OneToManyField;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-import org.apache.isis.viewer.dnd.view.text.ObjectTitleText;
-import org.apache.isis.viewer.dnd.view.text.TitleText;
-
-// TODO use ObjectBorder to provide the basic border functionality
-public class TreeNodeBorder extends AbstractBorder {
- private static final int BORDER = 13;
- private static final int BOX_PADDING = 2;
- private static final int BOX_SIZE = 9;
- private static final int BOX_X_OFFSET = 5;
- private final static Text LABEL_STYLE = Toolkit.getText(ColorsAndFonts.TEXT_NORMAL);
- private static final Logger LOG = LoggerFactory.getLogger(TreeNodeBorder.class);
- private final int baseline;
- private final IconGraphic icon;
- private final ViewSpecification replaceWithSpecification;
- private final TitleText text;
-
- public TreeNodeBorder(final View wrappedView, final ViewSpecification replaceWith) {
- super(wrappedView);
-
- replaceWithSpecification = replaceWith;
-
- icon = new IconGraphic(this, LABEL_STYLE);
- text = new ObjectTitleText(this, LABEL_STYLE);
- final int height = icon.getSize().getHeight();
-
- baseline = icon.getBaseline() + 1;
-
- left = 22;
- right = 0 + BORDER;
- top = height + 2;
- bottom = 0;
- }
-
- private int canOpen() {
- return ((NodeSpecification) getSpecification()).canOpen(getContent());
- }
-
- @Override
- protected Bounds contentArea() {
- return new Bounds(getLeft(), getTop(), wrappedView.getSize().getWidth(), wrappedView.getSize().getHeight());
- }
-
- @Override
- public void debugDetails(final DebugBuilder debug) {
- debug.append("TreeNodeBorder " + left + " pixels\n");
- debug.append(" titlebar " + (top) + " pixels\n");
- debug.append(" replace with " + replaceWithSpecification);
- debug.append(" text " + text);
- debug.append(" icon " + icon);
- super.debugDetails(debug);
-
- }
-
- @Override
- public DragEvent dragStart(final DragStart drag) {
- if (drag.getLocation().getX() > getSize().getWidth() - right) {
- final View dragOverlay = new DragViewOutline(getView());
- return new ViewDragImpl(this, new Offset(drag.getLocation()), dragOverlay);
- } else if (overBorder(drag.getLocation())) {
- return Toolkit.getViewFactory().createDragContentOutline(this, drag.getLocation());
- } else {
- return super.dragStart(drag);
- }
- }
-
- @Override
- public void draw(final Canvas canvas) {
- final Color secondary1 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY1);
- final Color secondary2 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY2);
- final Color secondary3 = Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3);
- /*
- * REVIEW if (getViewAxis(TableAxis.class) != null) { if
- * (((SelectableViewAxis)
- * getViewAxis(SelectableViewAxis.class)).isSelected(getView())) {
- * canvas.drawSolidRectangle(left, 0, getSize().getWidth() - left, top,
- * Toolkit.getColor(ColorsAndFonts.COLOR_PRIMARY2)); secondary2 =
- * secondary1; } }
- */
- if (getState().isObjectIdentified()) {
- canvas.drawRectangle(left, 0, getSize().getWidth() - left, top, secondary2);
-
- final int xExtent = getSize().getWidth();
- canvas.drawSolidRectangle(xExtent - BORDER + 1, 1, BORDER - 2, top - 2, secondary3);
- canvas.drawLine(xExtent - BORDER, 0, xExtent - BORDER, top - 2, secondary2);
- }
-
- // lines
- int x = 0;
- final int y = top / 2;
- canvas.drawLine(x, y, x + left, y, secondary2);
-
- final boolean isOpen = getSpecification().isOpen();
- final int canOpen = canOpen();
- final boolean addBox = isOpen || canOpen != NodeSpecification.CANT_OPEN;
- if (addBox) {
- x += BOX_X_OFFSET;
- canvas.drawLine(x, y, x + BOX_SIZE - 1, y, secondary3);
- canvas.drawSolidRectangle(x, y - BOX_SIZE / 2, BOX_SIZE, BOX_SIZE, Toolkit.getColor(ColorsAndFonts.COLOR_WHITE));
- canvas.drawRectangle(x, y - BOX_SIZE / 2, BOX_SIZE, BOX_SIZE, secondary1);
-
- if (canOpen == NodeSpecification.UNKNOWN) {
-
- } else {
- final Color black = Toolkit.getColor(ColorsAndFonts.COLOR_BLACK);
- canvas.drawLine(x + BOX_PADDING, y, x + BOX_SIZE - 1 - BOX_PADDING, y, black);
- if (!isOpen) {
- x += BOX_SIZE / 2;
- canvas.drawLine(x, y - BOX_SIZE / 2 + BOX_PADDING, x, y + BOX_SIZE / 2 - BOX_PADDING, black);
- }
- }
- }
-
- final View[] nodes = getSubviews();
- if (nodes.length > 0) {
- final int y1 = top / 2;
- final View node = nodes[nodes.length - 1];
- final int y2 = top + node.getLocation().getY() + top / 2;
- canvas.drawLine(left - 1, y1, left - 1, y2, secondary2);
- }
-
- // icon & title
- x = left + 1;
- icon.draw(canvas, x, baseline);
- x += icon.getSize().getWidth();
- final int maxWith = getSize().getWidth() - x;
- text.draw(canvas, x, baseline, maxWith);
-
- if (Toolkit.debug) {
- canvas.drawRectangleAround(getBounds(), Toolkit.getColor(ColorsAndFonts.COLOR_DEBUG_BASELINE));
- }
-
- // draw components
- super.draw(canvas);
- }
-
- @Override
- public void entered() {
- getState().setContentIdentified();
- getState().setViewIdentified();
- wrappedView.entered();
- markDamaged();
- }
-
- @Override
- public void exited() {
- getState().clearObjectIdentified();
- getState().clearViewIdentified();
- wrappedView.exited();
- markDamaged();
- }
-
- @Override
- public void firstClick(final Click click) {
- final int x = click.getLocation().getX();
- final int y = click.getLocation().getY();
-
- if (withinBox(x, y)) {
- if (canOpen() == NodeSpecification.UNKNOWN) {
- resolveContent();
- markDamaged();
- }
- LOG.debug((getSpecification().isOpen() ? "close" : "open") + " node " + getContent().getAdapter());
- if (canOpen() == NodeSpecification.CAN_OPEN) {
- final View newView = replaceWithSpecification.createView(getContent(), getViewAxes(), -1);
- getParent().replaceView(getView(), newView);
- }
- /*
- * } else if (y < top && x > left && click.button1()) { if
- * (canOpen() == NodeSpecification.UNKNOWN) { resolveContent();
- * markDamaged(); } selectNode();
- */
- } else {
- super.firstClick(click);
- }
- }
-
- @Override
- public int getBaseline() {
- return wrappedView.getBaseline() + baseline;
- }
-
- @Override
- public Size getRequiredSize(final Size maximumSize) {
- final Size size = super.getRequiredSize(maximumSize);
- // size.extendHeight(2 * VPADDING);
- size.ensureWidth(left + ViewConstants.HPADDING + icon.getSize().getWidth() + text.getSize().getWidth() + ViewConstants.HPADDING + right);
- return size;
- }
-
- @Override
- public void objectActionResult(final ObjectAdapter result, final Placement placement) {
- if (getContent() instanceof OneToManyField && result instanceof ObjectAdapter) {
- // same as InternalCollectionBorder
- final OneToManyField internalCollectionContent = (OneToManyField) getContent();
- final OneToManyAssociation field = internalCollectionContent.getOneToManyAssociation();
- final ObjectAdapter target = ((ObjectContent) getParent().getContent()).getObject();
-
- final Consent about = field.isValidToAdd(target, result);
- if (about.isAllowed()) {
- field.addElement(target, result);
- }
- }
- super.objectActionResult(result, placement);
- }
-
- private void resolveContent() {
- ObjectAdapter parent = getParent().getContent().getAdapter();
- if (!(parent instanceof ObjectAdapter)) {
- parent = getParent().getParent().getContent().getAdapter();
- }
-
- if (getContent() instanceof FieldContent) {
- final ObjectAssociation field = ((FieldContent) getContent()).getField();
- IsisContext.getPersistenceSession().resolveField(parent, field);
- } else if (getContent() instanceof CollectionContent) {
- IsisContext.getPersistenceSession().resolveImmediately(parent);
- } else if (getContent() instanceof CollectionElement) {
- IsisContext.getPersistenceSession().resolveImmediately(getContent().getAdapter());
- }
- }
-
- @Override
- public void secondClick(final Click click) {
- final int x = click.getLocation().getX();
- final int y = click.getLocation().getY();
- if (y < top && x > left) {
- if (canOpen() == NodeSpecification.UNKNOWN) {
- resolveContent();
- markDamaged();
- }
- final Location location = getAbsoluteLocation();
- location.translate(click.getLocation());
- getWorkspace().addWindowFor(getContent().getAdapter(), new Placement(this));
- } else {
- super.secondClick(click);
- }
- }
-
- // TODO remove
- private void selectNode() {
- /*
- * if (getViewAxis(SelectableViewAxis.class) != null) {
- * ((SelectableViewAxis)
- * getViewAxis(SelectableViewAxis.class)).selected(getView()); }
- */
- }
-
- @Override
- public String toString() {
- return wrappedView.toString() + "/TreeNodeBorder";
- }
-
- @Override
- public ViewAreaType viewAreaType(final Location mouseLocation) {
- final Bounds bounds = new Bounds(left + 1, 0, getSize().getWidth() - left - BORDER, top);
- if (bounds.contains(mouseLocation)) {
- return ViewAreaType.CONTENT;
- } else {
- return super.viewAreaType(mouseLocation);
- }
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet options) {
- super.viewMenuOptions(options);
- TreeDisplayRules.menuOptions(options);
-
- options.add(new UserActionAbstract("Select node") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- selectNode();
- }
-
- @Override
- public String getDescription(final View view) {
- return "Show this node in the right-hand pane";
- }
- });
-
- final ObjectAdapter adapter = getView().getContent().getAdapter();
- if (adapter instanceof ObjectAdapter && (adapter.isGhost() /*|| adapter.getResolveState().isPartlyResolved() */)) {
- options.add(new UserActionAbstract("Load object") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- resolveContent();
- }
- });
- }
- }
-
- private boolean withinBox(final int x, final int y) {
- return x >= BOX_X_OFFSET && x <= BOX_X_OFFSET + BOX_SIZE && y >= (top - BOX_SIZE) / 2 && y <= (top + BOX_SIZE) / 2;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeSpecification.java
deleted file mode 100644
index 29754a4..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeSpecification.java
+++ /dev/null
@@ -1,104 +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.dnd.tree;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-
-/**
- * Specification for a tree browser frame with a tree displaying only
- * collections and objects containing collections.
- */
-public class TreeSpecification implements ViewSpecification {
- private final OpenCollectionNodeSpecification openCollection;
- private final OpenObjectNodeSpecification openObject;
-
- public TreeSpecification() {
- final ClosedObjectNodeSpecification closedObject = new ClosedObjectNodeSpecification(false); // ,
- // new
- // SelectObjectBorder.Factory());
- final NodeSpecification closedCollection = new ClosedCollectionNodeSpecification();
- final EmptyNodeSpecification noNode = new EmptyNodeSpecification();
-
- openCollection = new OpenCollectionNodeSpecification();
- openCollection.setCollectionSubNodeSpecification(noNode);
- openCollection.setObjectSubNodeSpecification(closedObject);
- openCollection.setReplacementNodeSpecification(closedCollection);
-
- openObject = new OpenObjectNodeSpecification();
- openObject.setCollectionSubNodeSpecification(closedCollection);
- openObject.setObjectSubNodeSpecification(noNode);
- openObject.setReplacementNodeSpecification(closedObject);
-
- closedObject.setReplacementNodeSpecification(openObject);
-
- closedCollection.setReplacementNodeSpecification(openCollection);
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.is(ViewRequirement.OPEN) && (openCollection.canDisplay(requirement) || openObject.canDisplay(requirement)) && requirement.isExpandable();
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- View rootNode;
- final ViewRequirement requirement = new ViewRequirement(content, ViewRequirement.CLOSED);
- if (openCollection.canDisplay(requirement)) {
- rootNode = openCollection.createView(content, axes, -1);
- } else {
- rootNode = openObject.createView(content, axes, -1);
- }
- return rootNode;
- }
-
- @Override
- public String getName() {
- return "Tree (not working)";
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return true;
- }
-
- @Override
- public boolean isReplaceable() {
- return false;
- }
-
- @Override
- public boolean isResizeable() {
- return false;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeWithDetailSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeWithDetailSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeWithDetailSpecification.java
deleted file mode 100644
index 80b34ea..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree/TreeWithDetailSpecification.java
+++ /dev/null
@@ -1,78 +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.dnd.tree;
-
-import org.apache.isis.viewer.dnd.tree2.CollectionTreeNodeSpecification;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.MasterDetailPanel;
-
-public class TreeWithDetailSpecification implements ViewSpecification {
- private final ViewSpecification treeSpecification;
-
- public TreeWithDetailSpecification() {
- // treeSpecification = new TreeSpecification();
- treeSpecification = CollectionTreeNodeSpecification.create()[0];
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return treeSpecification.canDisplay(requirement);
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- return new MasterDetailPanel(content, this, treeSpecification);
- }
-
- @Override
- public String getName() {
- return "Tree and details (experimental)";
- }
-
- @Override
- public boolean isAligned() {
- return false;
- }
-
- @Override
- public boolean isOpen() {
- return true;
- }
-
- @Override
- public boolean isReplaceable() {
- return true;
- }
-
- @Override
- public boolean isResizeable() {
- return true;
- }
-
- @Override
- public boolean isSubView() {
- return false;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/CollectionTreeNodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/CollectionTreeNodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/CollectionTreeNodeSpecification.java
deleted file mode 100644
index 41e5be3..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/CollectionTreeNodeSpecification.java
+++ /dev/null
@@ -1,69 +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.dnd.tree2;
-
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.form.ExpandableViewBorder;
-import org.apache.isis.viewer.dnd.icon.IconElementFactory;
-import org.apache.isis.viewer.dnd.icon.SubviewIconSpecification;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.border.IconBorder;
-import org.apache.isis.viewer.dnd.view.border.SelectObjectBorder;
-import org.apache.isis.viewer.dnd.view.composite.AbstractCollectionViewSpecification;
-
-public class CollectionTreeNodeSpecification extends AbstractCollectionViewSpecification {
-
- public static ViewSpecification[] create() {
- final CollectionTreeNodeSpecification collectionNodeSpec = new CollectionTreeNodeSpecification();
- final ObjectTreeNodeSpecification objectNodeSpec = new ObjectTreeNodeSpecification();
- final SubviewIconSpecification iconSpec = new SubviewIconSpecification();
-
- collectionNodeSpec.addSubviewDecorator(new SelectObjectBorder.Factory());
- collectionNodeSpec.addSubviewDecorator(new ExpandableViewBorder.Factory(iconSpec, objectNodeSpec, null));
- collectionNodeSpec.addViewDecorator(new IconBorder.Factory(Toolkit.getText(ColorsAndFonts.TEXT_NORMAL)));
- objectNodeSpec.addSubviewDecorator(new SelectObjectBorder.Factory());
- objectNodeSpec.addSubviewDecorator(new ExpandableViewBorder.Factory(iconSpec, objectNodeSpec, collectionNodeSpec));
- // objectNodeSpec.addSubviewDecorator(new FieldLabelsDecorator());
- objectNodeSpec.addViewDecorator(new IconBorder.Factory(Toolkit.getText(ColorsAndFonts.TEXT_NORMAL)));
- return new ViewSpecification[] { collectionNodeSpec, objectNodeSpec };
- }
-
- @Override
- protected ViewFactory createElementFactory() {
- return new IconElementFactory();
- }
-
- @Override
- public String getName() {
- return "Collection tree (experimental)";
- }
-
- // TODO this should be available if an item can be given more space
- /*
- * @Override public boolean canDisplay(final Content content,
- * ViewRequirement requirement) { return content.isCollection() &&
- * requirement.is(ViewRequirement.CLOSED) &&
- * requirement.is(ViewRequirement.SUBVIEW) &&
- * requirement.is(ViewRequirement.SUBVIEW); }
- */
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/ObjectTreeNodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/ObjectTreeNodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/ObjectTreeNodeSpecification.java
deleted file mode 100644
index ede0af1..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/ObjectTreeNodeSpecification.java
+++ /dev/null
@@ -1,43 +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.dnd.tree2;
-
-import org.apache.isis.viewer.dnd.form.AbstractObjectViewSpecification;
-import org.apache.isis.viewer.dnd.icon.IconElementFactory;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-
-public class ObjectTreeNodeSpecification extends AbstractObjectViewSpecification {
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return super.canDisplay(requirement) && requirement.isExpandable();
- }
-
- @Override
- protected ViewFactory createFieldFactory() {
- return new IconElementFactory();
- }
-
- @Override
- public String getName() {
- return "Object tree (experimental)";
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/TreeNodeSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/TreeNodeSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/TreeNodeSpecification.java
deleted file mode 100644
index 6d1ad2b..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/tree2/TreeNodeSpecification.java
+++ /dev/null
@@ -1,122 +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.dnd.tree2;
-
-import org.apache.isis.viewer.dnd.form.ExpandableViewBorder;
-import org.apache.isis.viewer.dnd.form.ExpandableViewBorder.Factory;
-import org.apache.isis.viewer.dnd.icon.IconElementFactory;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.SubviewDecorator;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.CollectionElementBuilder;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.ObjectFieldBuilder;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-import org.apache.isis.viewer.dnd.view.composite.ViewBuilder;
-
-public class TreeNodeSpecification extends CompositeViewSpecification {
-
- public TreeNodeSpecification() {
- builder = new ViewBuilder() {
- ViewBuilder objectBuilder = new ObjectFieldBuilder(new ViewFactory() {
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- if (content.isTextParseable() || content.getAdapter() == null) {
- return null;
- } else if (content.isObject()) {
- return new IconElementFactory().createView(content, axes, 0); // TreeNodeSpecification.this.createView(content,
- // axes);
- } else {
- return TreeNodeSpecification.this.createView(content, axes, -1);
- }
- }
- });
-
- ViewBuilder collectiontBuilder = new CollectionElementBuilder(new IconElementFactory());
-
- {
- final Factory decorator = new ExpandableViewBorder.Factory(null, TreeNodeSpecification.this, null);
- objectBuilder.addSubviewDecorator(decorator);
- collectiontBuilder.addSubviewDecorator(decorator);
-
- }
-
- @Override
- public void addSubviewDecorator(final SubviewDecorator decorator) {
- }
-
- @Override
- public void build(final View view, final Axes axes) {
- synchronized (view) {
- (view.getContent().isCollection() ? collectiontBuilder : objectBuilder).build(view, axes);
- }
- }
-
- @Override
- public void createAxes(final Axes axes, final Content content) {
- }
-
- @Override
- public boolean isOpen() {
- return false;
- }
-
- @Override
- public boolean isReplaceable() {
- return true;
- }
-
- @Override
- public boolean isSubView() {
- return true;
- }
-
- @Override
- public boolean canDragView() {
- return true;
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet options, final View view) {
- }
- };
- }
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && requirement.isExpandable();
- }
-
- @Override
- public String getName() {
- return "Tree Node (not working)";
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/Properties.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/Properties.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/Properties.java
deleted file mode 100644
index 664f9b4..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/Properties.java
+++ /dev/null
@@ -1,160 +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.dnd.util;
-
-import java.util.StringTokenizer;
-
-import org.apache.isis.core.commons.config.ConfigurationConstants;
-import org.apache.isis.core.commons.config.IsisConfigurationException;
-import org.apache.isis.core.metamodel.facets.typeof.TypeOfFacet;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.core.runtime.system.context.IsisContext;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-
-public class Properties {
-
- public static final String PROPERTY_BASE = ConfigurationConstants.ROOT + "viewer.dnd.";
-
- public static Size getSize(final String name, final Size defaultSize) {
- String initialSize = optionFor(name);
- if (initialSize == null) {
- initialSize = IsisContext.getConfiguration().getString(name);
- }
- if (initialSize != null) {
- final StringTokenizer st = new StringTokenizer(initialSize, "x");
- if (st.countTokens() == 2) {
- int width = 0;
- int height = 0;
- width = Integer.valueOf(st.nextToken().trim()).intValue();
- height = Integer.valueOf(st.nextToken().trim()).intValue();
- return new Size(width, height);
- } else {
- throw new IsisConfigurationException("Size not specified correctly in " + name + ": " + initialSize);
- }
- }
- return defaultSize;
- }
-
- public static void saveSizeOption(final String name, final Size size) {
- final String value = size.getWidth() + "x" + size.getHeight();
- IsisContext.getUserProfile().getOptions().addOption(name, value);
- }
-
- public static Location getLocation(final String name, final Location defaultLocation) {
- String initialLocation = optionFor(name);
- if (initialLocation == null) {
- initialLocation = IsisContext.getConfiguration().getString(name);
- }
- if (initialLocation != null) {
- final StringTokenizer st = new StringTokenizer(initialLocation, ",");
- if (st.countTokens() == 2) {
- int x = 0;
- int y = 0;
- x = Integer.valueOf(st.nextToken().trim()).intValue();
- y = Integer.valueOf(st.nextToken().trim()).intValue();
- return new Location(x, y);
- } else {
- throw new IsisConfigurationException("Location not specified correctly in " + name + ": " + initialLocation);
- }
- }
- return defaultLocation;
- }
-
- private static String optionFor(final String name) {
- return IsisContext.inSession() ? IsisContext.getUserProfile().getOptions().getString(name) : null;
- }
-
- public static void saveLocationOption(final String name, final Location location) {
- final String value = location.getX() + "," + location.getY();
- IsisContext.getUserProfile().getOptions().addOption(name, value);
- }
-
- public static String getString(final String name) {
- String value = optionFor(PROPERTY_BASE + name);
- if (value == null) {
- value = IsisContext.getConfiguration().getString(PROPERTY_BASE + name);
- }
- return value;
- }
-
- public static void setStringOption(final String name, final String value) {
- IsisContext.getUserProfile().getOptions().addOption(PROPERTY_BASE + name, value);
- }
-
- public static Options getOptions(final String name) {
- return IsisContext.getUserProfile().getOptions().getOptions(name);
- }
-
- public static String getDefaultIconViewOptions() {
- return getString("view.icon-default");
- }
-
- public static String getDefaultObjectViewOptions() {
- return getString("view.object-default");
- }
-
- public static String getDefaultCollectionViewOptions() {
- return getString("view.collection-default");
- }
-
- public static Options getViewConfigurationOptions(final ViewSpecification specification) {
- final Options settingsOptions = getOptions("views.configuration");
- final String specificationName = specification.getName();
- return settingsOptions.getOptions(specificationName);
- }
-
- public static Options getDefaultViewOptions(final ObjectSpecification specification) {
- final Options settingsOptions = getOptions("views.type-default");
- String name;
- if (specification.isParentedOrFreeCollection()) {
- name = "collection:" + specification.getFacet(TypeOfFacet.class).valueSpec().getFullIdentifier();
- } else {
- name = specification.getFullIdentifier();
- }
- final Options viewOptions = settingsOptions.getOptions(name);
- return viewOptions;
- }
-
- public static Options getUserViewSpecificationOptions(final String specificationName) {
- final Options settingsOptions = getOptions("views.user-defined");
- return settingsOptions.getOptions(specificationName);
- }
-
- public static Object loadClass(final Options viewOptions, final String name) {
- final String specificationName = viewOptions.getString(name);
- if (specificationName != null) {
- try {
- final Class<?> specificationClass = Class.forName(specificationName);
- return specificationClass.newInstance();
- } catch (final ClassNotFoundException e) {
- throw new ViewerException(e);
- } catch (final InstantiationException e) {
- throw new ViewerException(e);
- } catch (final IllegalAccessException e) {
- throw new ViewerException(e);
- }
- }
- return null;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/ViewerException.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/ViewerException.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/ViewerException.java
deleted file mode 100644
index dd3a66d..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/util/ViewerException.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.dnd.util;
-
-import org.apache.isis.core.commons.exceptions.IsisException;
-
-public class ViewerException extends IsisException {
- private static final long serialVersionUID = 1L;
-
- public ViewerException() {
- }
-
- public ViewerException(final String message) {
- super(message);
- }
-
- public ViewerException(final String messageFormat, final Object... args) {
- super(messageFormat, args);
- }
-
- public ViewerException(final String message, final Throwable cause) {
- super(message, cause);
- }
-
- public ViewerException(final Throwable cause) {
- super(cause);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Axes.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Axes.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Axes.java
deleted file mode 100644
index 11a71ae..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Axes.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.dnd.view;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.core.commons.util.ToString;
-import org.apache.isis.viewer.dnd.util.ViewerException;
-
-public class Axes {
- private static final Logger LOG = LoggerFactory.getLogger(Axes.class);
- private final Map<Class<?>, ViewAxis> axes = new HashMap<Class<?>, ViewAxis>();
-
- public void add(final ViewAxis axis) {
- if (axis != null) {
- final Class<? extends ViewAxis> cls = axis.getClass();
- add(axis, cls);
- }
- }
-
- public void add(final ViewAxis axis, final Class<? extends ViewAxis> cls) {
- final ViewAxis previous = axes.put(cls, axis);
- if (previous != null) {
- LOG.debug(axis + " replacing " + previous);
- } else {
- LOG.debug("adding " + axis);
- }
- }
-
- public <T extends ViewAxis> T getAxis(final Class<T> axisClass) {
- final ViewAxis viewAxis = axes.get(axisClass);
- if (viewAxis == null) {
- throw new ViewerException("No axis of type " + axisClass + " in " + this);
- }
- return (T) viewAxis;
- }
-
- public boolean contains(final Class<? extends ViewAxis> axisClass) {
- return axes.containsKey(axisClass);
- }
-
- public void add(final Axes axes) {
- this.axes.putAll(axes.axes);
- }
-
- @Override
- public String toString() {
- // TODO provide flag to list as elements, rather than fields
- final ToString s = new ToString(this);
- for (final ViewAxis axis : axes.values()) {
- s.append(axis.toString());
- }
- return s.toString();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/BackgroundTask.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/BackgroundTask.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/BackgroundTask.java
deleted file mode 100644
index 0b7f5bb..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/BackgroundTask.java
+++ /dev/null
@@ -1,28 +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.dnd.view;
-
-public interface BackgroundTask {
- void execute();
-
- String getName();
-
- String getDescription();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ButtonAction.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ButtonAction.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ButtonAction.java
deleted file mode 100644
index f030197..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ButtonAction.java
+++ /dev/null
@@ -1,26 +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.dnd.view;
-
-public interface ButtonAction extends UserAction {
-
- boolean isDefault();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Click.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Click.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Click.java
deleted file mode 100644
index d16bcf7..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Click.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.dnd.view;
-
-import org.apache.isis.viewer.dnd.drawing.Location;
-
-public interface Click {
-
- Location getLocationWithinViewer();
-
- Location getLocation();
-
- boolean button2();
-
- boolean button1();
-
- boolean button3();
-
- boolean isAlt();
-
- boolean isShift();
-
- boolean isCtrl();
-
- void subtract(int left, int top);
-
- void subtract(Location location);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Command.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Command.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Command.java
deleted file mode 100644
index feff988..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Command.java
+++ /dev/null
@@ -1,30 +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.dnd.view;
-
-public interface Command {
- String getDescription();
-
- void undo();
-
- void execute();
-
- String getName();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/CompositeViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/CompositeViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/CompositeViewSpecification.java
deleted file mode 100644
index d99660f..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/CompositeViewSpecification.java
+++ /dev/null
@@ -1,24 +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.dnd.view;
-
-public interface CompositeViewSpecification extends ViewSpecification {
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Content.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Content.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Content.java
deleted file mode 100644
index 958b332..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Content.java
+++ /dev/null
@@ -1,116 +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.dnd.view;
-
-import org.apache.isis.core.commons.debug.DebugBuilder;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.consent.Consent;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-import org.apache.isis.viewer.dnd.drawing.Image;
-
-public interface Content {
-
- /**
- * Determines if the specified content can be drop on this content.
- */
- Consent canDrop(Content sourceContent);
-
- /**
- * Allows this content to add menu options to the set of menu options the
- * user will see for this content.
- *
- * @see #viewMenuOptions(UserActionSet)
- */
- void contentMenuOptions(UserActionSet options);
-
- void debugDetails(DebugBuilder debug);
-
- /**
- * Implements the response to the dropping of the specified content onto
- * this content.
- */
- ObjectAdapter drop(Content sourceContent);
-
- String getDescription();
-
- String getHelp();
-
- /**
- * The name of the icon to use to respresent the object represented by this
- * content.
- */
- String getIconName();
-
- /**
- * The icon to use to respresent the object represented by this content.
- */
- Image getIconPicture(int iconHeight);
-
- String getId();
-
- /**
- * The object represented by this content.
- */
- ObjectAdapter getAdapter();
-
- ObjectAdapter[] getOptions();
-
- /**
- * The specification of the object represented by this content.
- */
- ObjectSpecification getSpecification();
-
- /**
- * Returns true if this content represents a CollectionAdapter.
- */
- boolean isCollection();
-
- /**
- * Returns true if this content represents a ObjectAdapter.
- */
- boolean isObject();
-
- /**
- * Returns true if the object represented by this content can be persisted.
- */
- boolean isPersistable();
-
- boolean isOptionEnabled();
-
- /**
- * Returns true if the object represented by this content is transient; has
- * not been persisted yet.
- */
- boolean isTransient();
-
- boolean isTextParseable();
-
- String title();
-
- /**
- * Allows this content to add menu options to the set of menu options the
- * user will see for this view.
- *
- * @see #contentMenuOptions(UserActionSet)
- */
- void viewMenuOptions(UserActionSet options);
-
- String windowTitle();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentDrag.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentDrag.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentDrag.java
deleted file mode 100644
index 9f4f0f0..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentDrag.java
+++ /dev/null
@@ -1,45 +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.dnd.view;
-
-import org.apache.isis.viewer.dnd.drawing.Location;
-
-/**
- * Details a drag event that affects a view's content (as opposed to the view
- * itself).
- */
-public interface ContentDrag extends Drag {
-
- Content getSourceContent();
-
- boolean isShift();
-
- Location getTargetLocation();
-
- Location getOffset();
-
- void subtract(int borderWidth, int borderWidth2);
-
- View getTargetView();
-
- // TODO rename to getSourceView
- View getSource();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentFactory.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentFactory.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentFactory.java
deleted file mode 100644
index 1f63aee..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/ContentFactory.java
+++ /dev/null
@@ -1,30 +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.dnd.view;
-
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-
-public interface ContentFactory {
-
- Content createRootContent(ObjectAdapter object);
-
- Content createFieldContent(ObjectAssociation field, ObjectAdapter object);
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Drag.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Drag.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Drag.java
deleted file mode 100644
index bc2c672..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Drag.java
+++ /dev/null
@@ -1,26 +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.dnd.view;
-
-/**
- * Details a drag event - from drag start to drop,
- */
-public interface Drag {
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragEvent.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragEvent.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragEvent.java
deleted file mode 100644
index c6cb34c..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragEvent.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.dnd.view;
-
-import org.apache.isis.viewer.dnd.drawing.Location;
-
-public interface DragEvent {
-
- void drag(View target, Location location, int modifiers);
-
- void cancel(Viewer viewer);
-
- void end(Viewer viewer);
-
- View getOverlay();
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragStart.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragStart.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragStart.java
deleted file mode 100644
index e701e55..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/DragStart.java
+++ /dev/null
@@ -1,33 +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.dnd.view;
-
-import org.apache.isis.viewer.dnd.drawing.Location;
-
-public interface DragStart extends Drag {
-
- Location getLocation();
-
- void subtract(int left, int top);
-
- void subtract(Location location);
-
- boolean isCtrl();
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Feedback.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Feedback.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Feedback.java
deleted file mode 100644
index c2a417e..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/Feedback.java
+++ /dev/null
@@ -1,78 +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.dnd.view;
-
-public interface Feedback {
-
- void showException(final Throwable e);
-
- void showArrowCursor();
-
- void showCrosshairCursor();
-
- void showDefaultCursor();
-
- void showTextCursor();
-
- void showHandCursor();
-
- void showMoveCursor();
-
- void showResizeDownCursor();
-
- void showResizeDownLeftCursor();
-
- void showResizeDownRightCursor();
-
- void showResizeLeftCursor();
-
- void showResizeRightCursor();
-
- void showResizeUpCursor();
-
- void showResizeUpLeftCursor();
-
- void showResizeUpRightCursor();
-
- void setBusy(final View view, BackgroundTask task);
-
- void clearBusy(final View view);
-
- boolean isBusy(View view);
-
- String getStatusBarOutput();
-
- void showMessagesAndWarnings();
-
- void setViewDetail(String string);
-
- void setAction(String actionText);
-
- void addMessage(String string);
-
- void setError(String string);
-
- void clearAction();
-
- void clearError();
-
- void showBusyState(View view);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/FocusManager.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/FocusManager.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/FocusManager.java
deleted file mode 100644
index 8b6b531..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/view/FocusManager.java
+++ /dev/null
@@ -1,57 +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.dnd.view;
-
-/**
- * Details where to move the focus to.
- */
-public interface FocusManager {
- /**
- * The next view within the container to move the focus to; move to next
- * field.
- */
- void focusNextView();
-
- /**
- * The previous view within the container to move the focus to; move to
- * previous field.
- */
- void focusPreviousView();
-
- /**
- * The parent view within the container to move the focus to; move up to
- * containing view in the hierachy.
- */
- void focusParentView();
-
- /**
- * The first child view within the container to move the focus to; move down
- * to the first view within the current view.
- */
- void focusFirstChildView();
-
- void focusLastChildView();
-
- void focusInitialChildView();
-
- View getFocus();
-
- void setFocus(View view);
-}