当前位置: 首页>>代码示例>>Java>>正文


Java SQLPowerUtils.displayCleanupErrors方法代码示例

本文整理汇总了Java中ca.sqlpower.util.SQLPowerUtils.displayCleanupErrors方法的典型用法代码示例。如果您正苦于以下问题:Java SQLPowerUtils.displayCleanupErrors方法的具体用法?Java SQLPowerUtils.displayCleanupErrors怎么用?Java SQLPowerUtils.displayCleanupErrors使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ca.sqlpower.util.SQLPowerUtils的用法示例。


在下文中一共展示了SQLPowerUtils.displayCleanupErrors方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: close

import ca.sqlpower.util.SQLPowerUtils; //导入方法依赖的package包/类
public boolean close() {
    CleanupExceptions cleanupObject = SQLPowerUtils.cleanupSPObject(workspace);
    SQLPowerUtils.displayCleanupErrors(cleanupObject, sessionContext);
    
   	SessionLifecycleEvent<WabitSession> lifecycleEvent =
   		new SessionLifecycleEvent<WabitSession>(this);
   	for (int i = lifecycleListeners.size() - 1; i >= 0; i--) {
   		lifecycleListeners.get(i).sessionClosing(lifecycleEvent);
   	}
   	
   	return true;
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:13,代码来源:WabitSessionImpl.java

示例2: removeContentBox

import ca.sqlpower.util.SQLPowerUtils; //导入方法依赖的package包/类
public void removeContentBox(ContentBox removeme) {
    if (removeme.getParent() != this) {
        throw new IllegalStateException("That's not my content box!");
    }
    CleanupExceptions cleanupObject = SQLPowerUtils.cleanupSPObject(removeme);
    SQLPowerUtils.displayCleanupErrors(cleanupObject, getSession().getContext());
    int index = contentBoxes.indexOf(removeme);
    if (index != -1) {
    	contentBoxes.remove(removeme);
    	fireChildRemoved(ContentBox.class, removeme, index);
    	removeme.setParent(null);
	}
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:14,代码来源:Page.java

示例3: setContentRenderer

import ca.sqlpower.util.SQLPowerUtils; //导入方法依赖的package包/类
/**
 * Sets the given content renderer as this box's provider of rendered
 * content.
 * <p>
 * Although content renderers are considered children of the content box
 * (and this method does cause child added/removed events), a content box
 * can only have one content renderer at a time, so if you call this method
 * when the current content renderer is non-null, the old renderer will be
 * replaced by the new one.
 * 
 * @param contentRenderer
 *            The new content renderer to use. Can be null, which means to
 *            remove the content render and render this content box
 *            incontent.
 */
public void setContentRenderer(ReportContentRenderer contentRenderer) {
	//not setting the content renderer if it is already set as it would
	//clean up the content renderer.
	if (contentRenderer == this.contentRenderer)  return;
	
    ReportContentRenderer oldContentRenderer = this.contentRenderer;
    if (oldContentRenderer != null) {
    	CleanupExceptions cleanupObject = SQLPowerUtils.cleanupSPObject(oldContentRenderer);
    	SQLPowerUtils.displayCleanupErrors(cleanupObject, getSession().getContext());
    	SQLPowerUtils.unlistenToHierarchy(oldContentRenderer, childListener);
        oldContentRenderer.setParent(null);
        fireChildRemoved(ReportContentRenderer.class, oldContentRenderer, 0);
    }
    this.contentRenderer = contentRenderer;
    WabitWorkspace workspace = WabitUtils.getWorkspace(this);
    if (contentRenderer != null) {
    	if (workspace == null || workspace.isMagicEnabled()) {
    		if (getParent() != null) {
    			getParent().setUniqueName(ContentBox.this,
    					"Content from " + contentRenderer.getName());
    		} else {
    			setName("Content from " + contentRenderer.getName());
    		}
    	}
        contentRenderer.setParent(this);
        SQLPowerUtils.listenToHierarchy(contentRenderer, childListener);
        fireChildAdded(ReportContentRenderer.class, contentRenderer, 0);
    } else {
    	if (workspace == null || workspace.isMagicEnabled()) {
    		setName(EMPTY_BOX_NAME);
    	}
    }
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:49,代码来源:ContentBox.java

示例4: removeNode

import ca.sqlpower.util.SQLPowerUtils; //导入方法依赖的package包/类
/**
 * This recursive method will remove the given node and all nodes that
 * are reachable from it from their parents based on the graph given.
 * <p>
 * package private for testing.
 * 
 * @param nodeToRemove
 *            The node to remove from its parents. The nodes reachable
 *            from this node based on the given graph will also be
 *            removed from their parents.
 * @param graph
 *            The graph that will decide what objects are adjacent to
 *            this node. As this method is being used for removing a
 *            {@link WabitObject} and its dependencies from the tree
 *            this graph should contain the {@link WabitObject} being
 *            removed by the action and all of the {@link WabitObject}s
 *            depending on this object and the dependent object's
 *            dependencies.
 * @return true if the node and its descendants were successful. False
 *         otherwise.
 * @throws ObjectDependentException
 *             Thrown if the node that was being removed is still
 *             dependent on other objects existing. This suggests that
 *             there is a problem in the graph given that should connect
 *             all of the objects to their dependencies.
 * @throws IllegalArgumentException
 *             Thrown if a node being removed is not a child of its
 *             parent. This suggests there is something wrong with the
 *             parent/child relationships in the workspace.
 */
boolean removeNode(SPObject nodeToRemove, WorkspaceGraphModel graph) throws IllegalArgumentException, ObjectDependentException  {
    boolean successfullyRemoved = true;
    for (SPObject dependent : graph.getAdjacentNodes(nodeToRemove)) {
        
        //Check if the dependency exists to prevent infinite recursion if there is
        //a cycle in the graph.
        if (!dependent.getDependencies().contains(nodeToRemove)) continue;
        
        dependent.removeDependency(nodeToRemove);
        successfullyRemoved = successfullyRemoved && removeNode(dependent, graph);
        if (logger.isDebugEnabled() && !successfullyRemoved) {
        	logger.debug("Could not remove " + dependent.getName());
        }
    }
    CleanupExceptions cleanupObject = SQLPowerUtils.cleanupSPObject(nodeToRemove);
    SQLPowerUtils.displayCleanupErrors(cleanupObject, upf);
    if (nodeToRemove.getParent() != null) {
        successfullyRemoved = successfullyRemoved && 
            nodeToRemove.getParent().removeChild(nodeToRemove);
    }
    if (logger.isDebugEnabled() && !successfullyRemoved) {
    	logger.debug("Failed to remove " + nodeToRemove.getName());
    }
    return successfullyRemoved;
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:56,代码来源:DeleteFromTreeAction.java


注:本文中的ca.sqlpower.util.SQLPowerUtils.displayCleanupErrors方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。