Package org.apache.isis.viewer.dnd.view

Examples of org.apache.isis.viewer.dnd.view.Content


            return;
        }

        final View[] subviews = view.getSubviews();
        for (final View fieldView : subviews) {
            final Content content = fieldView.getContent();
            if (content instanceof RootObject) {
                checkFields(saveState, fieldView, forObject);
            } else if (content instanceof FieldContent) {
                final boolean isMandatory = ((FieldContent) content).isMandatory();
                final boolean isEditable = ((FieldContent) content).isEditable().isAllowed();
                final ObjectAdapter field = content.getAdapter();
                final boolean isFieldEmpty = field == null;
                if (isMandatory && isEditable && isFieldEmpty) {
                    final String parameterName = ((FieldContent) content).getFieldName();
                    saveState.addMissingField(parameterName);
View Full Code Here


            String description = null;
            String help = null;
            String name = null;

            if (forView != null && forView.getContent() != null) {
                final Content content = forView.getContent();
                description = content.getDescription();
                help = content.getHelp();
                name = content.getId();
                name = name == null ? content.title() : name;
            }

            helpViewer.open(forView.getAbsoluteLocation(), name, description, help);

        }
View Full Code Here

    @Override
    public void saveOpenObjects() {
        final List<ObjectAdapter> objects = new ArrayList<ObjectAdapter>();
        for (final View view : rootView.getSubviews()) {
            final Content content = view.getContent();
            if (content instanceof ObjectContent) {
                objects.add(((ObjectContent) content).getAdapter());
            }
        }
        IsisContext.getUserProfileLoader().saveSession(objects);
View Full Code Here

    private static final Logger LOG = Logger.getLogger(ViewUpdateNotifierImpl.class);
    protected Hashtable<ObjectAdapter, Vector<View>> viewListByAdapter = new Hashtable<ObjectAdapter, Vector<View>>();

    @Override
    public void add(final View view) {
        final Content content = view.getContent();
        if (content != null && content.isObject()) {
            final ObjectAdapter adapter = content.getAdapter();

            if (adapter != null) {
                Vector<View> viewsToNotify;

                if (viewListByAdapter.containsKey(adapter)) {
View Full Code Here

        return "Views for object details (observers)";
    }

    @Override
    public void remove(final View view) {
        final Content content = view.getContent();
        if (content == null || !content.isObject()) {
            // nothing to do
            return;
        }
        if (LOG.isDebugEnabled()) {
            LOG.debug("removing " + content + " for " + view);
View Full Code Here

    // REVIEW why can only objects be set to busy? Specifically the service icon
    // do not show as bust when a
    // long standing option is being set up when a menu is being created.
    @Override
    public void setBusy(final View view, final BackgroundTask task) {
        final Content content = view.getContent();
        if (content != null && content.isObject()) {
            final ObjectAdapter object = ((ObjectContent) content).getObject();
            busy.addElement(object);
        }
        showBusyState(view);
View Full Code Here

    }

    @Override
    public boolean isBusy(final View view) {
        if (view != null) {
            final Content content = view.getContent();
            if (content != null && content.isObject()) {
                final ObjectAdapter object = ((ObjectContent) content).getObject();
                if (busy.contains(object)) {
                    return true;
                }
            }
View Full Code Here

    public void execute(final Workspace workspace, final View view, final Location at) {
        BackgroundWork.runTaskInBackground(view, new BackgroundTask() {
            @Override
            public void execute() {
                final ActionHelper helper = ActionHelper.createInstance(target, action);
                Content content;
                if (target == null && action.getOnType().isService() || target != null && target.getSpecification().isNotCollection()) {
                    content = new ObjectActionContent(helper);
                } else if (target.getSpecification().isCollection()) {
                    content = new CollectionActionContent(helper);
                } else {
View Full Code Here

        return content.canSet(dragSource);
    }

    @Override
    public void dragIn(final ContentDrag drag) {
        final Content sourceContent = drag.getSourceContent();
        if (sourceContent instanceof ObjectContent) {
            final ObjectAdapter source = ((ObjectContent) sourceContent).getObject();
            final Consent canDrop = canDrop(source);
            if (canDrop.isAllowed()) {
                getState().setCanDrop();
            } else {
                getState().setCantDrop();
            }
            final String actionText = canDrop.isVetoed() ? canDrop.getReason() : "Set to " + sourceContent.title();
            getFeedbackManager().setAction(actionText);
        } else {
            getState().setCantDrop();
        }
View Full Code Here

        super("Debug...", ActionType.DEBUG);
    }

    @Override
    public void execute(final Workspace workspace, final View view, final Location at) {
        final Content content = view.getContent();
        final ObjectAdapter object = content == null ? null : content.getAdapter();

        final List<DebuggableWithTitle> debug = Lists.newArrayList();
        if (content instanceof PerspectiveContent) {
            final PerspectiveEntry perspectiveEntry = ((PerspectiveContent) content).getPerspective();
            debug.add(UserProfilesDebugUtil.asDebuggableWithTitle(perspectiveEntry));
        } else {
            debug.add(new DebugObjectSpecification(content.getSpecification()));
        }
        if (object != null) {
            debug.add(new DebugAdapter(object));
            debug.add(new DebugObjectGraph(object));
        }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.view.Content

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.