本文整理汇总了Java中org.eclipse.wst.sse.core.internal.provisional.INodeNotifier类的典型用法代码示例。如果您正苦于以下问题:Java INodeNotifier类的具体用法?Java INodeNotifier怎么用?Java INodeNotifier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
INodeNotifier类属于org.eclipse.wst.sse.core.internal.provisional包,在下文中一共展示了INodeNotifier类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: initAdapter
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
protected void initAdapter(INodeAdapter adapter, INodeNotifier node) {
// Assert.isTrue(cmDocumentManager == null);
// Assert.isTrue(fCMDocumentManagerListener == null);
//
// // register for CMDocumentManager events
// ModelQueryAdapter mqadapter = (ModelQueryAdapter)
// node.getAdapterFor(ModelQueryAdapter.class);
// if (mqadapter != null) {
// ModelQuery mquery = mqadapter.getModelQuery();
// if ((mquery != null) && (mquery.getCMDocumentManager() != null)) {
// cmDocumentManager = mquery.getCMDocumentManager();
// fCMDocumentManagerListener = new CMDocumentManagerListenerImpl();
// cmDocumentManager.addListener(fCMDocumentManagerListener);
// }
// }
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:17,代码来源:JFaceNodeAdapterFactory.java
示例2: pairReplaced
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* attrReplaced method
*
* @param element
* org.w3c.dom.Element
* @param newAttr
* org.w3c.dom.IJSONNode
* @param oldAttr
* org.w3c.dom.IJSONNode
*/
public void pairReplaced(IJSONObject element, IJSONPair newAttr,
IJSONPair oldAttr) {
if (element == null)
return;
IJSONNode attr = null;
IJSONValue oldValue = null;
IJSONValue newValue = null;
if (oldAttr != null) {
attr = oldAttr;
oldValue = oldAttr.getValue();
}
if (newAttr != null) {
attr = newAttr;
newValue = newAttr.getValue();
}
IJSONNode notifier = (IJSONNode) element;
int offset = notifier.getStartOffset();
notify(notifier, INodeNotifier.CHANGE, attr, oldValue, newValue, offset);
propertyChanged(notifier);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:31,代码来源:JSONModelNotifierImpl.java
示例3: childReplaced
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* childReplaced method
*
* @param parentNode
* org.w3c.dom.Node
* @param newChild
* org.w3c.dom.Node
* @param oldChild
* org.w3c.dom.Node
*/
@Override
public void childReplaced(IJSONNode parentNode, IJSONNode newChild,
IJSONNode oldChild) {
if (parentNode == null)
return;
IJSONNode notifier = (IJSONNode) parentNode;
int type = INodeNotifier.CHANGE;
if (newChild == null)
type = INodeNotifier.REMOVE;
else if (oldChild == null)
type = INodeNotifier.ADD;
int offset = notifier.getStartOffset();
notify(notifier, type, oldChild, oldChild, newChild, offset);
structureChanged(notifier);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:26,代码来源:JSONModelNotifierImpl.java
示例4: notifyStructureChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
private void notifyStructureChanged(IJSONNode root) {
if (root == null)
return;
INodeNotifier notifier = (INodeNotifier) root;
try {
// Its important to "keep going" if exception occurs, since this
// notification
// comes in between "about to change" and "changed" events. We do
// log, however,
// since would indicate a program error.
notifier.notify(INodeNotifier.STRUCTURE_CHANGED, null, null, null,
-1);
} catch (Exception e) {
Logger.logException(
"A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[INodeNotifier.STRUCTURE_CHANGED] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:21,代码来源:JSONModelNotifierImpl.java
示例5: cleanupModel
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
public void cleanupModel(IStructuredModel structuredModel, int start,
int length) {
JSONFormatUtil formatUtil = JSONFormatUtil.getInstance();
if (structuredModel instanceof IJSONModel) {
IJSONDocument doc = ((IJSONModel) structuredModel).getDocument();
IJSONSourceFormatter formatter = JSONSourceFormatterFactory
.getInstance().getSourceFormatter((INodeNotifier) doc);
StringBuilder buf = formatter.cleanup(doc);
if (buf != null) {
int startOffset = ((IndexedRegion) doc).getStartOffset();
int endOffset = ((IndexedRegion) doc).getEndOffset();
formatUtil.replaceSource(doc.getModel(), startOffset, endOffset
- startOffset, buf.toString());
}
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:17,代码来源:CleanupProcessorJSON.java
示例6: attrReplaced
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* attrReplaced method
*
* @param element
* org.w3c.dom.Element
* @param newAttr
* org.w3c.dom.Attr
* @param oldAttr
* org.w3c.dom.Attr
*/
public void attrReplaced(Element element, Attr newAttr, Attr oldAttr) {
if (element == null)
return;
Attr attr = null;
String oldValue = null;
String newValue = null;
if (oldAttr != null) {
attr = oldAttr;
oldValue = oldAttr.getValue();
}
if (newAttr != null) {
attr = newAttr;
newValue = newAttr.getValue();
}
IDOMNode notifier = (IDOMNode) element;
int offset = notifier.getStartOffset();
notify(notifier, INodeNotifier.CHANGE, attr, oldValue, newValue, offset);
propertyChanged(notifier);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:30,代码来源:FMModelNotifier.java
示例7: notifyStructureChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
private void notifyStructureChanged(Node root) {
if (root == null)
return;
INodeNotifier notifier = (INodeNotifier) root;
try {
// Its important to "keep going" if exception occurs, since this
// notification
// comes in between "about to change" and "changed" events. We do
// log, however,
// since would indicate a program error.
notifier.notify(INodeNotifier.STRUCTURE_CHANGED, null, null, null,
-1);
} catch (Exception e) {
Logger
.logException(
"A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[INodeNotifier.STRUCTURE_CHANGED] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:22,代码来源:FMModelNotifier.java
示例8: getNodeNotifiers
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
protected Set<INodeNotifier> getNodeNotifiers(Node node) {
Set<INodeNotifier> set = new HashSet<INodeNotifier>();
if (node instanceof INodeNotifier)
set.add((INodeNotifier)node);
if (node instanceof Element) {
Element econfig = XPagesDOMUtil.getAttributeElement((Element)node, EXT_LIB_ATTR_CONFIGURATION);
if (econfig instanceof INodeNotifier) {
set.add((INodeNotifier)econfig);
}
}
return set;
}
开发者ID:OpenNTF,项目名称:XPagesExtensionLibrary,代码行数:18,代码来源:ApplicationLayoutAttributesProvider.java
示例9: getAdapter
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* Returns the JFace adapter for the specified object.
*
* @param adaptable
* java.lang.Object The object to get the adapter for
*/
protected IJFaceNodeAdapter getAdapter(Object adaptable) {
if (adaptable instanceof INodeNotifier) {
INodeAdapter adapter = ((INodeNotifier) adaptable)
.getAdapterFor(IJFaceNodeAdapter.class);
if (adapter instanceof IJFaceNodeAdapter) {
return (IJFaceNodeAdapter) adapter;
}
}
return null;
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:17,代码来源:JFaceNodeLabelProvider.java
示例10: getAdapter
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* Returns the JFace adapter for the specified object.
*
* @param adaptable
* java.lang.Object The object to get the adapter for
*/
protected IJFaceNodeAdapter getAdapter(Object adaptable) {
if (adaptable instanceof INodeNotifier) {
INodeAdapter adapter = ((INodeNotifier) adaptable).getAdapterFor(IJFaceNodeAdapter.class);
if (adapter instanceof IJFaceNodeAdapter) {
return (IJFaceNodeAdapter) adapter;
}
}
return null;
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:16,代码来源:JFaceNodeContentProvider.java
示例11: notifyChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* Called by the object being adapter (the notifier) when something has
* changed.
*/
public void notifyChanged(INodeNotifier notifier, int eventType,
Object changedFeature, Object oldValue, Object newValue, int pos) {
// future_TODO: the 'uijobs' used in this method were added to solve
// threading problems when the dom
// is updated in the background while the editor is open. They may be
// a bit overkill and not that useful.
// (That is, may be be worthy of job manager management). If they are
// found to be important enough to leave in,
// there's probably some optimization that can be done.
if (notifier instanceof IJSONNode) {
Collection listeners = fAdapterFactory.getListeners();
Iterator iterator = listeners.iterator();
while (iterator.hasNext()) {
Object listener = iterator.next();
// https://bugs.eclipse.org/bugs/show_bug.cgi?id=90637
// if (notifier instanceof Node && (listener instanceof
// StructuredViewer) && (eventType ==
// INodeNotifier.STRUCTURE_CHANGED || (eventType ==
// INodeNotifier.CHANGE && changedFeature == null))) {
if ((listener instanceof StructuredViewer)
&& ((eventType == INodeNotifier.STRUCTURE_CHANGED)
|| (eventType == INodeNotifier.CONTENT_CHANGED) || (eventType == INodeNotifier.CHANGE))) {
if (DEBUG) {
System.out
.println("JFaceNodeAdapter notified on event type > " + eventType); //$NON-NLS-1$
}
// refresh on structural and "unknown" changes
StructuredViewer structuredViewer = (StructuredViewer) listener;
// https://w3.opensource.ibm.com/bugzilla/show_bug.cgi?id=5230
if (structuredViewer.getControl() != null) {
getRefreshJob().refresh(structuredViewer,
(IJSONNode) notifier);
}
}
}
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:44,代码来源:JFaceNodeAdapter.java
示例12: createAdapter
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* Create a new JFace adapter for the JSON node passed in
*/
@Override
protected INodeAdapter createAdapter(INodeNotifier node) {
if (singletonAdapter == null) {
// create the JFaceNodeAdapter
singletonAdapter = new JFaceNodeAdapter(this);
initAdapter(singletonAdapter, node);
}
return singletonAdapter;
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:13,代码来源:JFaceNodeAdapterFactory.java
示例13: getParentFormatter
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
protected IJSONSourceGenerator getParentFormatter(IJSONNode node) {
IJSONNode parent = node.getParentNode();
if (parent != null) {
IJSONSourceGenerator formatter = (IJSONSourceGenerator) ((INodeNotifier) parent)
.getAdapterFor(IJSONSourceFormatter.class);
if (formatter == null) {
formatter = JSONSourceFormatterFactory.getInstance()
.getSourceFormatter((INodeNotifier) parent);
}
return formatter;
}
return null;
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:16,代码来源:AbstractJSONSourceFormatter.java
示例14: NotifyEvent
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
NotifyEvent(INodeNotifier notifier, int type, Object changedFeature,
Object oldValue, Object newValue, int pos) {
this.notifier = notifier;
this.type = type;
this.changedFeature = changedFeature;
this.oldValue = oldValue;
this.newValue = newValue;
this.pos = pos;
this.reason = ""; //$NON-NLS-1$
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:11,代码来源:JSONModelNotifierImpl.java
示例15: notify
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
private void notify(INodeNotifier notifier, int eventType,
Object changedFeature, Object oldValue, Object newValue, int pos) {
if (notifier == null)
return;
if (this.changing && !this.flushing) {
// defer notification
if (this.fEvents == null)
this.fEvents = new ArrayList();
// we do not defer anything if we are doing a new Model,
// except for the document event, since all others are
// trivial and not needed at that initial point.
// But even for that one document event, in the new model case,
// it is still important to defer it.
if ((!doingNewModel)
|| (((IJSONNode) notifier).getNodeType() == IJSONNode.DOCUMENT_NODE)) {
this.fEvents.add(new NotifyEvent(notifier, eventType,
changedFeature, oldValue, newValue, pos));
}
return;
}
try {
// Its important to "keep going" if exception occurs, since this
// notification
// comes in between "about to change" and "changed" events. We do
// log, however,
// since would indicate a program error.
notifier.notify(eventType, changedFeature, oldValue, newValue, pos);
} catch (Exception e) {
Logger.logException(
"A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-json,代码行数:35,代码来源:JSONModelNotifierImpl.java
示例16: childReplaced
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
* childReplaced method
*
* @param parentNode
* org.w3c.dom.Node
* @param newChild
* org.w3c.dom.Node
* @param oldChild
* org.w3c.dom.Node
*/
public void childReplaced(Node parentNode, Node newChild, Node oldChild) {
if (parentNode == null)
return;
IDOMNode notifier = (IDOMNode) parentNode;
int type = INodeNotifier.CHANGE;
if (newChild == null)
type = INodeNotifier.REMOVE;
else if (oldChild == null)
type = INodeNotifier.ADD;
int offset = notifier.getStartOffset();
notify(notifier, type, oldChild, oldChild, newChild, offset);
structureChanged(notifier);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:24,代码来源:FMModelNotifier.java
示例17: editableChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
public void editableChanged(Node node) {
if (node == null)
return;
IDOMNode notifier = (IDOMNode) node;
int offset = notifier.getStartOffset();
notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
propertyChanged(notifier);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:9,代码来源:FMModelNotifier.java
示例18: endTagChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
public void endTagChanged(Element element) {
if (element == null)
return;
IDOMNode notifier = (IDOMNode) element;
int offset = notifier.getStartOffset();
notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
propertyChanged(element);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:11,代码来源:FMModelNotifier.java
示例19: notify
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
private void notify(INodeNotifier notifier, int eventType,
Object changedFeature, Object oldValue, Object newValue, int pos) {
if (notifier == null)
return;
if (this.changing && !this.flushing) {
// defer notification
if (this.events == null)
this.events = new Vector();
// we do not defer anything if we are doing a new Model,
// except for the document event, since all others are
// trivial and not needed at that initial point.
// But even for that one document event, in the new model case,
// it is still important to defer it.
if ((!doingNewModel)
|| (((Node) notifier).getNodeType() == Node.DOCUMENT_NODE)) {
this.events.addElement(new NotifyEvent(notifier, eventType,
changedFeature, oldValue, newValue, pos));
}
return;
}
try {
// Its important to "keep going" if exception occurs, since this
// notification
// comes in between "about to change" and "changed" events. We do
// log, however,
// since would indicate a program error.
notifier.notify(eventType, changedFeature, oldValue, newValue, pos);
} catch (Exception e) {
Logger
.logException(
"A structured model client threw following exception during adapter notification (" + INodeNotifier.EVENT_TYPE_STRINGS[eventType] + " )", e); //$NON-NLS-1$ //$NON-NLS-2$
}
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:36,代码来源:FMModelNotifier.java
示例20: startTagChanged
import org.eclipse.wst.sse.core.internal.provisional.INodeNotifier; //导入依赖的package包/类
/**
*/
public void startTagChanged(Element element) {
if (element == null)
return;
IDOMNode notifier = (IDOMNode) element;
int offset = notifier.getStartOffset();
notify(notifier, INodeNotifier.CHANGE, null, null, null, offset);
propertyChanged(element);
}
开发者ID:angelozerr,项目名称:eclipse-wtp-freemarker,代码行数:11,代码来源:FMModelNotifier.java
注:本文中的org.eclipse.wst.sse.core.internal.provisional.INodeNotifier类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论