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


Java SPListener类代码示例

本文整理汇总了Java中ca.sqlpower.object.SPListener的典型用法代码示例。如果您正苦于以下问题:Java SPListener类的具体用法?Java SPListener怎么用?Java SPListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: listenToHierarchy

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
/**
* Adds the given listeners to the hierarchy of {@link SPObject}s rooted at
* <code>root</code>.
* 
* @param root
*            The object at the top of the subtree to listen to. Must not be
*            null.
* @param spcl
*            The SQL Power child listener to add to root and all its
*            SPObject descendants. If you do not want {@link SPChildEvent}s,
*            you can provide null for this parameter.
*/
  public static void listenToHierarchy(SPObject root, SPListener spcl) {
      root.addSPListener(spcl);
      if (root.allowsChildren()) {
          List<? extends SPObject> children;
          if (root instanceof SQLObject) {
              children = ((SQLObject) root).getChildrenWithoutPopulating();
          } else {
              children = root.getChildren();
          }
      	for (SPObject wob : children) {
      		listenToHierarchy(wob, spcl);
      	}
      }
  }
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:27,代码来源:SQLPowerUtils.java

示例2: listenToShallowHierarchy

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
/**
 * This method is similar to listenToHierarchy but only listens to the 
 * first two levels in the tree, i.e. the listener is not added to the 
 * grand children of the root. See 
 * {@link #lisenToHierachy(MatchMakerListener listener, MatchMakerObject root)}
 */
public static void listenToShallowHierarchy(SPListener listener, SPObject root) {
	root.addSPListener(listener);
	logger.debug("listenToShallowHierarchy: \"" + root.getName() + "\" (" +
			root.getClass().getName() + ") children: " + root.getChildren());
	for (SPObject spo : root.getChildren()) {
		spo.addSPListener(listener);
	}
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:15,代码来源:SQLPowerUtils.java

示例3: unlistenToHierarchy

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
/**
* Removes the given listeners from the hierarchy of {@link SPObject}s
* rooted at <code>root</code>.
* 
* @param root
*            The object at the top of the subtree to unlisten to. Must not
*            be null.
* @param spcl
*            The SQL Power child listener to remove from root and all its
*            SPObject descendants. If you do not want to unlisten to
*            {@link SPChildEvent}s, you can provide null for this
*            parameter.
*/
  public static void unlistenToHierarchy(SPObject root, SPListener spcl) {
      root.removeSPListener(spcl);
      if (root.allowsChildren()) {
          List<? extends SPObject> children;
          if (root instanceof SQLObject) {
              children = ((SQLObject) root).getChildrenWithoutPopulating();
          } else {
              children = root.getChildren();
          }
      	for (SPObject wob : children) {
      		unlistenToHierarchy(wob, spcl);
      	}
      }
  }
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:28,代码来源:SQLPowerUtils.java

示例4: commitObjects

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
/**
 * Commits the persisted {@link WabitObject}s
 * 
 * @throws SPPersistenceException
 */
private void commitObjects() throws SPPersistenceException {
	List<PersistedSPObject> orderedPersistedObjects = new ArrayList<PersistedSPObject>(persistedObjects.size());
	orderedPersistedObjects.addAll(persistedObjects.values());
	Collections.sort(orderedPersistedObjects, persistedObjectComparator);
	
	for (PersistedSPObject pwo : orderedPersistedObjects) {
		if (pwo.isLoaded())
			continue;
		SPObject parent = SQLPowerUtils.findByUuid(root, pwo
				.getParentUUID(), SPObject.class);
		SPObject spo = loadWabitObject(pwo);
		if (spo != null) {
			SPListener removeChildOnAddListener = new AbstractSPListener() {
				public void childRemoved(SPChildEvent e) {
					objectsToRemoveRollbackList.add(
							new RemovedObjectEntry(e.getSource().getUUID(), e.getChild(), e.getIndex()));
				}
			};
			parent.addSPListener(removeChildOnAddListener);
			// FIXME Terrible hack, see bug 2326
			parent.addChild(spo, Math.min(pwo.getIndex(), parent.getChildren(spo.getClass()).size()));
			parent.removeSPListener(removeChildOnAddListener);
			this.persistedObjectsRollbackList.add(
				new PersistedObjectEntry(
					parent.getUUID(), 
					spo.getUUID()));
		}
	}
	persistedObjects.clear();
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:36,代码来源:WabitSessionPersister.java

示例5: getSPListeners

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
@NonProperty
public List<SPListener> getSPListeners() {
		return listeners;
}
 
开发者ID:SQLPower,项目名称:sqlpower-library,代码行数:5,代码来源:SQLObject.java

示例6: hasListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
public boolean hasListener(SPListener listener) {
	return listeners.contains(listener);
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:4,代码来源:TestingAbstractMatchMakerObject.java

示例7: removeWabitListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
public void removeWabitListener(SPListener l) {
	// no-op
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:4,代码来源:StubWabitObject.java

示例8: addSPListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
@Override
public void addSPListener(SPListener l) {
	
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:5,代码来源:StubMungeStep.java

示例9: removeSPListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
@Override
public void removeSPListener(SPListener l) {
	
}
 
开发者ID:SQLPower,项目名称:power-matchmaker,代码行数:5,代码来源:StubMungeStep.java

示例10: addSPListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
public void addSPListener(SPListener l) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:5,代码来源:StubWabitObject.java

示例11: removeSPListener

import ca.sqlpower.object.SPListener; //导入依赖的package包/类
public void removeSPListener(SPListener l) {
	// TODO Auto-generated method stub
	
}
 
开发者ID:SQLPower,项目名称:wabit,代码行数:5,代码来源:StubWabitObject.java


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