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:25 UTC
[24/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/calendar/CalendarView.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/CalendarView.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/CalendarView.java
deleted file mode 100644
index bd3caf5..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/CalendarView.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.dnd.calendar;
-
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import org.apache.isis.viewer.dnd.drawing.Bounds;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.field.DatePickerControl;
-import org.apache.isis.viewer.dnd.toolbar.ToolbarView;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.FocusManager;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.composite.CompositeView;
-import org.apache.isis.viewer.dnd.view.content.NullContent;
-import org.apache.isis.viewer.dnd.view.control.AbstractButtonAction;
-import org.apache.isis.viewer.dnd.view.control.Button;
-
-public class CalendarView extends CompositeView {
- private static final Logger LOG = LoggerFactory.getLogger(CalendarView.class);
-
- protected CalendarView(final Content content, final ViewSpecification specification) {
- super(content, specification);
- }
-
- @Override
- public void doLayout(final Size maximumSize) {
- LOG.debug("doLayout() " + maximumSize + " " + getSize());
- final View toolbar = getSubviews()[0];
- maximumSize.contract(getPadding());
- final Size toolbarSize = toolbar.getRequiredSize(maximumSize);
- LOG.debug(" toolbar " + toolbarSize);
- Bounds bounds = new Bounds(toolbarSize);
- toolbar.setBounds(bounds);
-
- final View grid = getSubviews()[1];
- final Size gridSize = getRequiredSize(Size.createMax());
- gridSize.contract(getPadding());
- gridSize.contractHeight(toolbarSize.getHeight());
- bounds = new Bounds(new Location(0, toolbarSize.getHeight()), gridSize);
- grid.setBounds(bounds);
- LOG.debug(" grid " + toolbarSize);
-
- }
-
- @Override
- public void setFocusManager(final FocusManager focusManager) {
- // this.focusManager = focusManager;
- }
-
- @Override
- public Size requiredSize(final Size availableSpace) {
- final Size workspace = getWorkspace().getSize();
- return new Size((int) (workspace.getWidth() * 0.8), (int) (workspace.getHeight() * 0.8));
- }
-
- @Override
- protected void buildView() {
- if (subviews().length == 0) {
- final CalendarGrid grid = new CalendarGrid(getContent());
- final ToolbarView toolbar = createToolbar(grid);
- addView(toolbar);
- addView(grid);
- } else {
- // TODO update grid view
- }
- }
-
- private ToolbarView createToolbar(final CalendarGrid calendar) {
- final ToolbarView toolbarView = new ToolbarView(getContent(), null);
-
- toolbarView.addView(new Button(new AbstractButtonAction("+Row") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.addRow();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("-Row") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.removeRow();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Across") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.acrossFirst();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Down") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.downFirst();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Next") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.nextPeriod();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Previous") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.previousePeriod();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Day") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.showSingleDay();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Days") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.showDays();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Weeks") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.showWeeks();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Months") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.showMonths();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Years") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.showYears();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Today") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- calendar.today();
- }
- }, this));
-
- toolbarView.addView(new Button(new AbstractButtonAction("Date") {
- @Override
- public void execute(final Workspace workspace, View view, final Location at) {
- final Content content = new NullContent() {
- };
- view = DatePickerControl.getPicker(content);
- calendar.today();
- getViewManager().setOverlayView(view);
- }
- }, this));
-
- return toolbarView;
- }
-
- /*
- * public void invalidateLayout() { // super.invalidateLayout(); View parent
- * = getParent(); if (parent != null) { // parent.invalidateLayout(); }
- * isInvalid = true; View toolbar = getSubviews()[0];
- * toolbar.invalidateLayout(); // View grid = getSubviews()[1]; //
- * grid.invalidateLayout(); } protected boolean isLayoutInvalid() { return
- * isInvalid; }
- */
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cell.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cell.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cell.java
deleted file mode 100644
index 02c4577..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cell.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.calendar;
-
-public class Cell {
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cells.java
deleted file mode 100644
index ba2e21a..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/Cells.java
+++ /dev/null
@@ -1,74 +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.calendar;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Calendar;
-import java.util.Date;
-
-public abstract class Cells {
- protected final DateFormat monthFormat = new SimpleDateFormat("MMM");
- protected final DateFormat dayFormat = new SimpleDateFormat("EEE");
- protected Calendar date;
-
- public Cells(final Cells replacing) {
- if (replacing == null) {
- today();
- } else {
- date = replacing.date;
- }
- }
-
- public void today() {
- date = Calendar.getInstance();
- roundDown();
- }
-
- public final void setDate(final Calendar date) {
- this.date = date;
- }
-
- public void roundDown() {
- }
-
- abstract int defaultRows();
-
- abstract int defaultColumns();
-
- abstract void add(int interval);
-
- abstract String title(int cell);
-
- public String header(final int cell) {
- return null;
- }
-
- public int getPeriodFor(final Date date) {
- final Calendar forDate = Calendar.getInstance();
- forDate.setTime(date);
- final int baseline = period(this.date);
- final int comparativePeriod = period(forDate);
- return baseline - comparativePeriod;
- }
-
- protected abstract int period(Calendar forDate);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/DayCells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/DayCells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/DayCells.java
deleted file mode 100644
index 3913c08..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/DayCells.java
+++ /dev/null
@@ -1,71 +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.calendar;
-
-import java.util.Calendar;
-
-public class DayCells extends Cells {
-
- public DayCells(final Cells replacing) {
- super(replacing);
- }
-
- @Override
- public int defaultColumns() {
- return 7;
- }
-
- @Override
- public int defaultRows() {
- return 2;
- }
-
- @Override
- public void add(final int interval) {
- date.add(Calendar.DAY_OF_WEEK, interval);
- }
-
- @Override
- public void roundDown() {
- final int offset = date.get(Calendar.DAY_OF_WEEK) - date.getFirstDayOfWeek();
- date.add(Calendar.DAY_OF_MONTH, -offset);
- }
-
- @Override
- public String title(final int cell) {
- final Calendar d = (Calendar) date.clone();
- d.add(Calendar.DAY_OF_WEEK, cell);
- final String displayName = dayFormat.format(d.getTime()) + " " + d.get(Calendar.DAY_OF_MONTH) + " " + monthFormat.format(d.getTime());
- return displayName;
- }
-
- @Override
- public String header(final int cell) {
- final Calendar d = (Calendar) date.clone();
- d.add(Calendar.DAY_OF_WEEK, cell);
- return dayFormat.format(d.getTime());
- }
-
- @Override
- protected int period(final Calendar forDate) {
- return forDate.get(Calendar.YEAR) * 12 - forDate.get(Calendar.DAY_OF_YEAR);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/MonthCells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/MonthCells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/MonthCells.java
deleted file mode 100644
index 7596e63..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/MonthCells.java
+++ /dev/null
@@ -1,62 +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.calendar;
-
-import java.util.Calendar;
-
-public class MonthCells extends Cells {
-
- public MonthCells(final Cells replacing) {
- super(replacing);
- }
-
- @Override
- public int defaultColumns() {
- return 4;
- }
-
- @Override
- public int defaultRows() {
- return 3;
- }
-
- @Override
- public void roundDown() {
- date.set(Calendar.MONTH, 0);
- }
-
- @Override
- public void add(final int interval) {
- date.add(Calendar.MONTH, interval);
- }
-
- @Override
- public String title(final int cell) {
- final Calendar d = (Calendar) date.clone();
- d.add(Calendar.MONTH, cell);
- final String displayName = monthFormat.format(d.getTime()) + " " + d.get(Calendar.YEAR);
- return displayName;
- }
-
- @Override
- protected int period(final Calendar forDate) {
- return forDate.get(Calendar.YEAR) * 12 - forDate.get(Calendar.MONTH);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/SingleDayCells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/SingleDayCells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/SingleDayCells.java
deleted file mode 100644
index 2726017..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/SingleDayCells.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.dnd.calendar;
-
-import java.util.Calendar;
-
-public class SingleDayCells extends Cells {
-
- public SingleDayCells(final Cells replacing) {
- super(replacing);
- }
-
- @Override
- public int defaultColumns() {
- return 1;
- }
-
- @Override
- public int defaultRows() {
- return 1;
- }
-
- @Override
- public void add(final int interval) {
- date.add(Calendar.DAY_OF_WEEK, interval);
- }
-
- @Override
- public String title(final int cell) {
- final Calendar d = (Calendar) date.clone();
- d.add(Calendar.DAY_OF_WEEK, cell);
- final String displayName = dayFormat.format(d.getTime()) + " " + d.get(Calendar.DAY_OF_MONTH) + " " + monthFormat.format(d.getTime());
- return displayName;
- }
-
- @Override
- protected int period(final Calendar forDate) {
- return forDate.get(Calendar.YEAR) * 12 - forDate.get(Calendar.DAY_OF_YEAR);
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/WeekCells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/WeekCells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/WeekCells.java
deleted file mode 100644
index 2e7c221..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/WeekCells.java
+++ /dev/null
@@ -1,61 +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.calendar;
-
-import java.util.Calendar;
-
-public class WeekCells extends Cells {
-
- public WeekCells(final Cells replacing) {
- super(replacing);
- }
-
- @Override
- public int defaultColumns() {
- return 4;
- }
-
- @Override
- public int defaultRows() {
- return 3;
- }
-
- @Override
- public void add(final int interval) {
- add(date, interval);
- }
-
- public void add(final Calendar d, final int interval) {
- d.add(Calendar.DAY_OF_MONTH, 7 * interval);
- }
-
- @Override
- public String title(final int cell) {
- final Calendar d = (Calendar) date.clone();
- add(d, cell);
- final String displayName = d.get(Calendar.DAY_OF_MONTH) + " " + monthFormat.format(d.getTime());
- return "w/b " + displayName;
- }
-
- @Override
- protected int period(final Calendar forDate) {
- return forDate.get(Calendar.YEAR) * 12 - forDate.get(Calendar.WEEK_OF_YEAR);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/YearCells.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/YearCells.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/YearCells.java
deleted file mode 100644
index 09f828a..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/calendar/YearCells.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.calendar;
-
-import java.util.Calendar;
-
-public class YearCells extends Cells {
-
- public YearCells(final Cells replacing) {
- super(replacing);
- }
-
- @Override
- public int defaultColumns() {
- return 4;
- }
-
- @Override
- public int defaultRows() {
- return 2;
- }
-
- @Override
- public void add(final int interval) {
- date.add(Calendar.YEAR, interval);
- }
-
- @Override
- public String title(final int cell) {
- final Calendar d = (Calendar) date.clone();
- d.add(Calendar.YEAR, cell);
- final String displayName = d.get(Calendar.YEAR) + "";
- return displayName;
- }
-
- @Override
- protected int period(final Calendar forDate) {
- return forDate.get(Calendar.YEAR);
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/ExpandableListSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/ExpandableListSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/ExpandableListSpecification.java
deleted file mode 100644
index 710bb8e..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/ExpandableListSpecification.java
+++ /dev/null
@@ -1,52 +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.combined;
-
-import org.apache.isis.viewer.dnd.form.ExpandableViewBorder;
-import org.apache.isis.viewer.dnd.icon.IconElementFactory;
-import org.apache.isis.viewer.dnd.view.ViewFactory;
-import org.apache.isis.viewer.dnd.view.composite.AbstractCollectionViewSpecification;
-
-public class ExpandableListSpecification extends AbstractCollectionViewSpecification {
-
- public ExpandableListSpecification() {
- builder.addSubviewDecorator(new ExpandableViewBorder.Factory());
- }
-
- @Override
- protected ViewFactory createElementFactory() {
- return new IconElementFactory();
- }
-
- @Override
- public String getName() {
- return "Expanding List (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/combined/FormWithTableSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/FormWithTableSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/FormWithTableSpecification.java
deleted file mode 100644
index 4c10e78..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/FormWithTableSpecification.java
+++ /dev/null
@@ -1,114 +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.combined;
-
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-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.form.FormSpecification;
-import org.apache.isis.viewer.dnd.table.InternalTableSpecification;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.composite.GridLayout;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-
-public class FormWithTableSpecification extends SplitViewSpecification {
-
- // REVIEW: confirm this rendering context
- final Where where = Where.OBJECT_FORMS;
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- @Override
- View createMainView(final Axes axes, final Content mainContent, final Content secondaryContent) {
- final View form1 = new FormSpecification() {
- @Override
- protected boolean include(final Content content, final int sequence) {
- return !secondaryContent.getId().equals(content.getId());
- };
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- final GridLayout gridLayout = new GridLayout();
- gridLayout.setSize(2);
- return gridLayout;
- }
- }.createView(mainContent, axes, -1);
- return form1;
- }
-
- @Override
- View createSecondaryView(final Axes axes, final Content fieldContent) {
- return new InternalTableSpecification().createView(fieldContent, axes, -1);
- }
-
- @Override
- Content determineSecondaryContent(final Content content) {
- final ObjectSpecification spec = content.getSpecification();
- final ObjectAdapter target = content.getAdapter();
- final AuthenticationSession session = IsisContext.getAuthenticationSession();
- final List<ObjectAssociation> fields = spec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, target, where));
- for (final ObjectAssociation field : fields) {
- if (field.isOneToManyAssociation()) {
- return Toolkit.getContentFactory().createFieldContent(field, target);
- }
- }
- return null;
- }
-
- /*
- *
- * @Override protected void init() { addSubviewDecorator(new
- * FieldLabelsDecorator() { public View decorate(Axes axes, View view) { if
- * (view.getContent().isCollection()) { return view; } else { return
- * super.decorate(axes, view); } } }); addViewDecorator(new
- * IconBorder.Factory()); }
- *
- * @Override protected SubviewSpec createFieldFactory() { return new
- * SubviewSpec() { public View createView(final Content content, Axes axes,
- * int sequence) { if (content.isCollection()) { return new
- * InternalTableSpecification().createView(content, axes, sequence); } else
- * { final ViewFactory factory = Toolkit.getViewFactory(); int requirement =
- * ViewRequirement.CLOSED | ViewRequirement.SUBVIEW; ViewRequirement
- * viewRequirement = new ViewRequirement(content, requirement); return
- * factory.createView(viewRequirement); } } }; }
- */
- @Override
- public String getName() {
- return "Form with table (experimental)";
- }
-
- @Override
- boolean validField(final ObjectAssociation field) {
- 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/combined/SplitViewAccess.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewAccess.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewAccess.java
deleted file mode 100644
index 3363563..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewAccess.java
+++ /dev/null
@@ -1,39 +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.combined;
-
-import java.util.List;
-
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.viewer.dnd.view.ViewAxis;
-
-public class SplitViewAccess implements ViewAxis {
-
- private final List<ObjectAssociation> fields;
-
- public SplitViewAccess(final List<ObjectAssociation> fields) {
- this.fields = fields;
- }
-
- public List<ObjectAssociation> getFields() {
- return fields;
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewBuilder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewBuilder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewBuilder.java
deleted file mode 100644
index 63a549d..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewBuilder.java
+++ /dev/null
@@ -1,73 +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.combined;
-
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.UserActionSet;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.composite.AbstractViewBuilder;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-
-class SplitViewBuilder extends AbstractViewBuilder {
-
- private final SplitViewSpecification splitViewSpecification;
-
- public SplitViewBuilder(final SplitViewSpecification splitViewSpecification) {
- this.splitViewSpecification = splitViewSpecification;
- }
-
- @Override
- public void createAxes(final Axes axes, final Content content) {
- super.createAxes(axes, content);
- axes.add(new SplitViewAccess(splitViewSpecification.determineAvailableFields(content)));
- }
-
- @Override
- public void build(final View view, final Axes axes) {
- if (view.getSubviews().length == 0) {
- final Content content = view.getContent();
- final Content fieldContent = splitViewSpecification.determineSecondaryContent(content);
-
- final View form1 = splitViewSpecification.createMainView(axes, content, fieldContent);
- view.addView(form1);
-
- final View labelledForm = splitViewSpecification.createSecondaryView(axes, fieldContent);
- view.addView(labelledForm);
- }
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet options, final View view) {
- super.viewMenuOptions(options, view);
-
- final SplitViewAccess axis = view.getViewAxes().getAxis(SplitViewAccess.class);
- for (final ObjectAssociation field : axis.getFields()) {
- options.add(new UserActionAbstract("Select " + field.getName()) {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- }
- });
- }
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewSpecification.java
deleted file mode 100644
index 66c5a4e..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/SplitViewSpecification.java
+++ /dev/null
@@ -1,90 +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.combined;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.isis.applib.annotation.Where;
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-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.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewSpecification;
-
-public abstract class SplitViewSpecification extends CompositeViewSpecification {
-
- // 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
- final Where where = Where.ANYWHERE;
-
- public SplitViewSpecification() {
- builder = new SplitViewBuilder(this);
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- if (requirement.isObject() && requirement.is(ViewRequirement.OPEN) && !requirement.isSubview()) {
- final Content fieldContent = determineSecondaryContent(requirement.getContent());
- return fieldContent != null && fieldContent.getAdapter() != null;
- } else {
- return false;
- }
- }
-
- abstract View createMainView(Axes axes, Content mainContent, final Content secondaryContent);
-
- abstract View createSecondaryView(Axes axes, final Content fieldContent);
-
- abstract Content determineSecondaryContent(Content content);
-
- Content field(final ObjectAssociation field, final Content content) {
- final ObjectSpecification spec = content.getSpecification();
- final ObjectAdapter target = content.getAdapter();
- return Toolkit.getContentFactory().createFieldContent(field, target);
- }
-
- List<ObjectAssociation> determineAvailableFields(final Content content) {
- final ObjectSpecification spec = content.getSpecification();
- final ObjectAdapter target = content.getAdapter();
- final AuthenticationSession session = IsisContext.getAuthenticationSession();
- final List<ObjectAssociation> fields = spec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, target, where));
- final List<ObjectAssociation> selectableFields = new ArrayList<ObjectAssociation>();
- for (final ObjectAssociation field : fields) {
- if (validField(field)) {
- selectableFields.add(field);
- }
- }
- return selectableFields;
- }
-
- abstract boolean validField(ObjectAssociation field);
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/TwoPartViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/TwoPartViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/TwoPartViewSpecification.java
deleted file mode 100644
index 302451e..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/combined/TwoPartViewSpecification.java
+++ /dev/null
@@ -1,91 +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.combined;
-
-import java.util.List;
-
-import org.apache.isis.core.commons.authentication.AuthenticationSession;
-import org.apache.isis.core.metamodel.adapter.ObjectAdapter;
-import org.apache.isis.core.metamodel.spec.ObjectSpecification;
-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.form.FormSpecification;
-import org.apache.isis.viewer.dnd.form.InternalFormSpecification;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.axis.LabelAxis;
-import org.apache.isis.viewer.dnd.view.base.Layout;
-import org.apache.isis.viewer.dnd.view.border.LabelBorder;
-import org.apache.isis.viewer.dnd.view.composite.ColumnLayout;
-
-public class TwoPartViewSpecification extends SplitViewSpecification {
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new ColumnLayout();
- }
-
- @Override
- View createMainView(final Axes axes, final Content mainContent, final Content secondaryContent) {
- final View form1 = new FormSpecification() {
- @Override
- protected boolean include(final Content content, final int sequence) {
- return !secondaryContent.getId().equals(content.getId());
- };
- }.createView(mainContent, axes, -1);
- return form1;
- }
-
- @Override
- View createSecondaryView(final Axes axes, final Content fieldContent) {
- final View form = new InternalFormSpecification().createView(fieldContent, axes, -1);
- final View labelledForm = LabelBorder.createFieldLabelBorder(new LabelAxis(), form);
- return labelledForm;
- }
-
- @Override
- @Deprecated
- Content determineSecondaryContent(final Content content) {
- final ObjectSpecification spec = content.getSpecification();
- final ObjectAdapter target = content.getAdapter();
- final AuthenticationSession session = IsisContext.getAuthenticationSession();
- final List<ObjectAssociation> fields = spec.getAssociations(Contributed.EXCLUDED, ObjectAssociation.Filters.dynamicallyVisible(session, target, where));
- for (final ObjectAssociation field : fields) {
- if (validField(field)) {
- return Toolkit.getContentFactory().createFieldContent(field, target);
- }
- }
- return null;
- }
-
- @Override
- boolean validField(final ObjectAssociation field) {
- return field.isOneToOneAssociation() && !field.getSpecification().isParseable();
- }
-
- @Override
- public String getName() {
- return "Two part object (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/configurable/ConfigurableCompositeViewBorder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableCompositeViewBorder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableCompositeViewBorder.java
deleted file mode 100644
index 32ffc80..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableCompositeViewBorder.java
+++ /dev/null
@@ -1,138 +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.configurable;
-
-import java.util.Enumeration;
-
-import org.apache.isis.core.commons.factory.InstanceUtil;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.viewer.dnd.configurable.GridListSpecification.ElementFactory;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.util.Properties;
-import org.apache.isis.viewer.dnd.view.Axes;
-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.ViewRequirement;
-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.UserViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewDecorator;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-
-public class ConfigurableCompositeViewBorder extends AbstractBorder {
-
- public static class Factory implements CompositeViewDecorator {
- private final ElementFactory elementSpecification;
-
- public Factory(final ElementFactory elementSpecification) {
- this.elementSpecification = elementSpecification;
- }
-
- @Override
- public View decorate(final View view, final Axes axes) {
- final ConfigurationAxis axis = new ConfigurationAxis();
- // TODO load previously saved settings for the type of elements
- // axis.loadSettings(view.getContent());
- axes.add(axis);
- return new ConfigurableCompositeViewBorder(view, elementSpecification);
- }
- }
-
- private ViewSpecification elementSpecification;
-
- protected ConfigurableCompositeViewBorder(final View view, final ElementFactory elementFactory) {
- super(view);
- }
-
- @Override
- public void loadOptions(final Options viewOptions) {
- super.loadOptions(viewOptions);
- final String elementsClass = viewOptions.getString("elements");
- if (elementsClass != null) {
- ViewSpecification specification;
- if (elementsClass.startsWith("user:")) {
- final String name = elementsClass.substring("user:".length());
- final String wrappedSpecificationClass = Properties.getUserViewSpecificationOptions(name).getString("wrapped-specification");
- final ViewSpecification wrappedSpectification = (ViewSpecification) InstanceUtil.createInstance(wrappedSpecificationClass);
- specification = new UserViewSpecification(wrappedSpectification, name);
- } else {
- specification = (ViewSpecification) InstanceUtil.createInstance(elementsClass);
- }
- if (specification != null) {
- getViewAxes().getAxis(ConfigurationAxis.class).setElementSpecification(specification);
- }
- }
- }
-
- @Override
- public void saveOptions(final Options viewOptions) {
- super.saveOptions(viewOptions);
- if (elementSpecification != null) {
- final boolean isUserSpecification = elementSpecification instanceof UserViewSpecification;
- String name;
- if (isUserSpecification) {
- name = "user:" + elementSpecification.getName();
- } else {
- name = elementSpecification.getClass().getName();
- }
- viewOptions.addOption("elements", name);
- }
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet menuOptions) {
- super.viewMenuOptions(menuOptions);
- final UserActionSet subOptions = menuOptions.addNewActionSet("Elements as");
- final View firstSubview = getSubviews()[0];
- final int status = ViewRequirement.OPEN | ViewRequirement.CLOSED | ViewRequirement.SUBVIEW | ViewRequirement.FIXED;
- final ViewRequirement viewRequirement = new ViewRequirement(firstSubview.getContent(), status);
- final Enumeration<ViewSpecification> possibleViews = Toolkit.getViewFactory().availableViews(viewRequirement);
- while (possibleViews.hasMoreElements()) {
- addElementAsOption(subOptions, possibleViews.nextElement());
- }
- }
-
- private void addElementAsOption(final UserActionSet subOptions, final ViewSpecification specification) {
- if (specification != elementSpecification) {
- subOptions.add(new UserActionAbstract(specification.getName()) {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- replaceElementViews(specification, view);
- }
- });
- }
- }
-
- private void replaceElementViews(final ViewSpecification specification, final View view) {
- elementSpecification = specification;
- removeAllSubviews(view);
- getViewAxes().getAxis(ConfigurationAxis.class).setElementSpecification(specification);
- invalidateContent();
- }
-
- private void removeAllSubviews(final View view) {
- final View[] subviews = view.getSubviews();
- for (final View subview : subviews) {
- view.removeView(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/configurable/ConfigurableFieldBorder.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableFieldBorder.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableFieldBorder.java
deleted file mode 100644
index 96cd86b..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableFieldBorder.java
+++ /dev/null
@@ -1,154 +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.configurable;
-
-import java.util.Enumeration;
-
-import org.apache.isis.viewer.dnd.drawing.Canvas;
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.drawing.Location;
-import org.apache.isis.viewer.dnd.drawing.Size;
-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.Toolkit;
-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.ViewAxis;
-import org.apache.isis.viewer.dnd.view.ViewRequirement;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-import org.apache.isis.viewer.dnd.view.ViewState;
-import org.apache.isis.viewer.dnd.view.Workspace;
-import org.apache.isis.viewer.dnd.view.axis.LabelAxis;
-import org.apache.isis.viewer.dnd.view.base.AbstractBorder;
-import org.apache.isis.viewer.dnd.view.base.BlankView;
-import org.apache.isis.viewer.dnd.view.border.LabelBorder;
-import org.apache.isis.viewer.dnd.view.option.ReplaceViewOption;
-import org.apache.isis.viewer.dnd.view.option.UserActionAbstract;
-
-public class ConfigurableFieldBorder extends AbstractBorder {
- public static final class Factory implements SubviewDecorator {
- @Override
- public ViewAxis createAxis(final Content content) {
- return null;
- }
-
- @Override
- public View decorate(final Axes axes, final View view) {
- return new ConfigurableFieldBorder(view);
- }
- }
-
- private static final int BORDER = 10;
-
- protected ConfigurableFieldBorder(final View view) {
- super(view);
- right = BORDER;
- }
-
- @Override
- public void viewMenuOptions(final UserActionSet menuOptions) {
- super.viewMenuOptions(menuOptions);
-
- menuOptions.add(new UserActionAbstract("Hide") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- final View parent = wrappedView.getParent();
- wrappedView = new BlankView(getContent());
- wrappedView.setParent(parent);
- wrappedView.setView(ConfigurableFieldBorder.this);
- invalidateLayout();
- }
-
- });
-
- menuOptions.add(new UserActionAbstract("Show label") {
- @Override
- public void execute(final Workspace workspace, final View view, final Location at) {
- if (wrappedView instanceof LabelBorder) {
- wrappedView = ((LabelBorder) wrappedView).getWrapped();
- } else {
- wrappedView = LabelBorder.createFieldLabelBorder(view.getParent().getViewAxes().getAxis(LabelAxis.class), wrappedView);
- }
- wrappedView.setView(ConfigurableFieldBorder.this);
- getView().invalidateLayout();
- }
- });
-
- replaceOptions(Toolkit.getViewFactory().availableViews(new ViewRequirement(getContent(), ViewRequirement.OPEN | ViewRequirement.CLOSED | ViewRequirement.SUBVIEW)), menuOptions); // openSubviews(content,
- // this),
- // options);
-
- }
-
- // TODO copied from AbstractView
- protected void replaceOptions(final Enumeration possibleViews, final UserActionSet options) {
- if (possibleViews.hasMoreElements()) {
- final UserActionSet suboptions = options.addNewActionSet("Replace with");
- while (possibleViews.hasMoreElements()) {
- final ViewSpecification specification = (ViewSpecification) possibleViews.nextElement();
-
- if (specification != getSpecification()) {
- final UserAction viewAs = new ReplaceViewOption(specification) {
- @Override
- protected void replace(final View view, final View withReplacement) {
- final View parent = wrappedView.getParent();
- wrappedView = LabelBorder.createFieldLabelBorder(view.getParent().getViewAxes().getAxis(LabelAxis.class), withReplacement);
- wrappedView.setParent(parent);
- wrappedView.setView(ConfigurableFieldBorder.this);
- invalidateLayout();
- }
- };
- suboptions.add(viewAs);
- }
- }
- }
- }
-
- @Override
- public void draw(final Canvas canvas) {
- super.draw(canvas);
-
- final ViewState state = getState();
- if (state.isViewIdentified()) {
- final Size s = getSize();
- final int xExtent = s.getWidth();
- if (state.isViewIdentified()) {
- canvas.drawSolidRectangle(xExtent - BORDER + 1, top, BORDER - 2, s.getHeight() - 2 * top, Toolkit.getColor(ColorsAndFonts.COLOR_SECONDARY3));
- }
- }
- }
-
- @Override
- public void entered() {
- getState().setViewIdentified();
- wrappedView.entered();
- markDamaged();
- }
-
- @Override
- public void exited() {
- getState().clearViewIdentified();
- wrappedView.exited();
- markDamaged();
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableObjectViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableObjectViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableObjectViewSpecification.java
deleted file mode 100644
index 18e5f51..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurableObjectViewSpecification.java
+++ /dev/null
@@ -1,61 +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.configurable;
-
-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.border.IconBorder;
-import org.apache.isis.viewer.dnd.view.composite.CompositeViewSpecification;
-import org.apache.isis.viewer.dnd.view.composite.FieldLabelsDecorator;
-import org.apache.isis.viewer.dnd.view.composite.GridLayout;
-import org.apache.isis.viewer.dnd.view.composite.GridLayoutControlBorder;
-import org.apache.isis.viewer.dnd.view.composite.ObjectFieldBuilder;
-import org.apache.isis.viewer.dnd.view.composite.StandardFields;
-
-public class ConfigurableObjectViewSpecification extends CompositeViewSpecification {
-
- public ConfigurableObjectViewSpecification() {
- builder = new ObjectFieldBuilder(new StandardFields());
- addSubviewDecorator(new FieldLabelsDecorator());
- addSubviewDecorator(new ConfigurableFieldBorder.Factory());
- addViewDecorator(new GridLayoutControlBorder.Factory());
- addViewDecorator(new IconBorder.Factory());
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && requirement.isOpen() && requirement.isExpandable() && requirement.isDesign();
- }
-
- @Override
- public String getName() {
- return "Configurable (experimental)";
- }
-
- /*
- * protected View decorateView(View view) { return new IconBorder(view); }
- */
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new GridLayout();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurationAxis.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurationAxis.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurationAxis.java
deleted file mode 100644
index 53744d0..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/ConfigurationAxis.java
+++ /dev/null
@@ -1,35 +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.configurable;
-
-import org.apache.isis.viewer.dnd.view.ViewAxis;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-
-public class ConfigurationAxis implements ViewAxis {
- private ViewSpecification elementSpecification;
-
- public void setElementSpecification(final ViewSpecification elementSpecification) {
- this.elementSpecification = elementSpecification;
- }
-
- public ViewSpecification getElementSpecification() {
- return elementSpecification;
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/FieldLayoutRequirement.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/FieldLayoutRequirement.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/FieldLayoutRequirement.java
deleted file mode 100644
index 81e4969..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/FieldLayoutRequirement.java
+++ /dev/null
@@ -1,38 +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.configurable;
-
-import org.apache.isis.viewer.dnd.view.View;
-import org.apache.isis.viewer.dnd.view.ViewSpecification;
-
-public class FieldLayoutRequirement {
- private View view;
-
- private boolean visible;
- private int columnSpan;
- private int rowSpan;
-
- private ViewSpecification spec;
- private boolean showLabel;
- private boolean mergeWithNext;
-
- private boolean allowGrowing;
- private boolean allowScrolling;
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/GridListSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/GridListSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/GridListSpecification.java
deleted file mode 100644
index 768e81b..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/GridListSpecification.java
+++ /dev/null
@@ -1,82 +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.configurable;
-
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.GlobalViewFactory;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-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.ViewSpecification;
-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.GridLayout;
-import org.apache.isis.viewer.dnd.view.composite.GridLayoutControlBorder;
-
-public class GridListSpecification extends CompositeViewSpecification implements ViewFactory {
-
- protected static class ElementFactory implements ViewFactory {
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- final GlobalViewFactory factory = Toolkit.getViewFactory();
-
- final ViewSpecification elementSpecification = axes.getAxis(ConfigurationAxis.class).getElementSpecification();
- if (elementSpecification == null) {
- final int defaultRequirement = ViewRequirement.CLOSED | ViewRequirement.SUBVIEW;
- final ViewRequirement viewRequirement = new ViewRequirement(content, defaultRequirement);
- return factory.createView(viewRequirement);
- } else {
- return elementSpecification.createView(content, axes, sequence);
- }
- }
- }
-
- public GridListSpecification() {
- final ElementFactory factory = new ElementFactory();
- builder = new CollectionElementBuilder(factory);
- // TODO allow to be switched on so that user can change the view for a
- // single element. This type of
- // view used for an element would not be stored.
- if (false) {
- addSubviewDecorator(new ConfigurableFieldBorder.Factory());
- }
-
- addViewDecorator(new ConfigurableCompositeViewBorder.Factory(factory));
- addViewDecorator(new GridLayoutControlBorder.Factory());
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isCollection() && requirement.isOpen() && !requirement.isSubview() && requirement.isDesign();
- }
-
- @Override
- public String getName() {
- return "Grid List";
- }
-
- @Override
- public Layout createLayout(final Content content, final Axes axes) {
- return new GridLayout();
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectField.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectField.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectField.java
deleted file mode 100644
index 468dc1c..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectField.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.dnd.configurable;
-
-import org.apache.isis.core.metamodel.spec.feature.ObjectAssociation;
-import org.apache.isis.core.runtime.userprofile.Options;
-import org.apache.isis.core.runtime.userprofile.OptionsClient;
-
-public class NewObjectField implements OptionsClient {
-
- private final ObjectAssociation field;
-
- public NewObjectField(final ObjectAssociation field) {
- this.field = field;
- }
-
- public boolean includeLabel() {
- return true;
- }
-
- public ObjectAssociation getField() {
- return field;
- }
-
- @Override
- public void loadOptions(final Options viewOptions) {
- }
-
- @Override
- public void saveOptions(final Options viewOptions) {
- viewOptions.addOption("field", field.getId());
- }
-
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectView.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectView.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectView.java
deleted file mode 100644
index 5ffa53c..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewObjectView.java
+++ /dev/null
@@ -1,114 +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.configurable;
-
-import java.util.ArrayList;
-import java.util.List;
-
-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.userprofile.Options;
-import org.apache.isis.viewer.dnd.drawing.Size;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-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.axis.LabelAxis;
-import org.apache.isis.viewer.dnd.view.border.LabelBorder;
-import org.apache.isis.viewer.dnd.view.composite.CompositeView;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-import org.apache.isis.viewer.dnd.view.content.FieldContent;
-
-public class NewObjectView extends CompositeView {
- StackLayout layout = new StackLayout();
- LabelAxis labelAxis = new LabelAxis();
- List<NewObjectField> fields = new ArrayList<NewObjectField>();
-
- public NewObjectView(final Content content, final ViewSpecification specification) {
- super(content, specification);
- }
-
- void addField(final NewObjectField field) {
- fields.add(field);
- addFieldView(field);
- invalidateContent();
- }
-
- @Override
- protected void buildView() {
- if (getSubviews().length == 0) {
- final ObjectAdapter object = getContent().getAdapter();
- final List<ObjectAssociation> associations = getContent().getSpecification().getAssociations(Contributed.EXCLUDED);
-
- final ObjectAssociation field = associations.get(0);
-
- addFieldView(object, field);
- addFieldView(object, associations.get(2));
- }
- }
-
- private void addFieldView(final ObjectAdapter object, final ObjectAssociation field) {
- final FieldContent fieldContent = (FieldContent) Toolkit.getContentFactory().createFieldContent(field, object);
- final ViewRequirement requirement = new ViewRequirement(fieldContent, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW);
- View fieldView = Toolkit.getViewFactory().createView(requirement);
-
- fieldView = LabelBorder.createFieldLabelBorder(labelAxis, fieldView);
-
- addView(fieldView);
- }
-
- private void addFieldView(final NewObjectField field) {
- final ObjectAdapter object = getContent().getAdapter();
- final FieldContent fieldContent = (FieldContent) Toolkit.getContentFactory().createFieldContent(field.getField(), object);
- final ViewRequirement requirement = new ViewRequirement(fieldContent, ViewRequirement.CLOSED | ViewRequirement.SUBVIEW);
- View fieldView = Toolkit.getViewFactory().createView(requirement);
- if (field.includeLabel()) {
- fieldView = LabelBorder.createFieldLabelBorder(labelAxis, fieldView);
- }
- addView(fieldView);
- }
-
- @Override
- protected void doLayout(final Size maximumSize) {
- layout.layout(this, maximumSize);
- }
-
- @Override
- protected Size requiredSize(final Size availableSpace) {
- return layout.getRequiredSize(this);
- }
-
- @Override
- public void loadOptions(final Options viewOptions) {
- final Options options = viewOptions.getOptions("fields");
- // options.options()
-
- }
-
- @Override
- public void saveOptions(final Options viewOptions) {
- for (final NewObjectField field : fields) {
- field.saveOptions(viewOptions.getOptions("fields"));
- }
-
- }
-}
http://git-wip-us.apache.org/repos/asf/isis/blob/a43dbdd9/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewViewSpecification.java
----------------------------------------------------------------------
diff --git a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewViewSpecification.java b/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewViewSpecification.java
deleted file mode 100644
index 0329c80..0000000
--- a/mothballed/component/viewer/dnd/impl/src/main/java/org/apache/isis/viewer/dnd/configurable/NewViewSpecification.java
+++ /dev/null
@@ -1,82 +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.configurable;
-
-import org.apache.isis.viewer.dnd.drawing.ColorsAndFonts;
-import org.apache.isis.viewer.dnd.view.Axes;
-import org.apache.isis.viewer.dnd.view.Content;
-import org.apache.isis.viewer.dnd.view.Toolkit;
-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.base.Layout;
-import org.apache.isis.viewer.dnd.view.border.IconBorder;
-import org.apache.isis.viewer.dnd.view.composite.StackLayout;
-
-public class NewViewSpecification implements ViewSpecification {
-
- protected Layout createLayout(final Content content, final Axes axes) {
- return new StackLayout();
- }
-
- @Override
- public boolean canDisplay(final ViewRequirement requirement) {
- return requirement.isObject() && requirement.isOpen();
- }
-
- @Override
- public String getName() {
- return "Object View";
- }
-
- @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 false;
- }
-
- @Override
- public View createView(final Content content, final Axes axes, final int sequence) {
- final NewObjectView view = new NewObjectView(content, this);
- View view2 = new IconBorder(view, Toolkit.getText(ColorsAndFonts.TEXT_TITLE));
- view2 = new ViewDesignBorder(view2, view);
- return view2;
- }
-
-}