• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java AnnotationModelEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: createAnnotations

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
private void createAnnotations(final ISourceNode linecoverage) {
  AnnotationModelEvent event = new AnnotationModelEvent(this);
  clear(event);
  final int firstline = linecoverage.getFirstLine();
  final int lastline = Math.min(linecoverage.getLastLine(),
      document.getNumberOfLines());
  try {
    for (int l = firstline; l <= lastline; l++) {
      final ILine line = linecoverage.getLine(l);
      if (line.getStatus() != ICounter.EMPTY) {
        final IRegion region = document.getLineInformation(l - 1);
        final CoverageAnnotation ca = new CoverageAnnotation(
            region.getOffset(), region.getLength(), line);
        annotations.add(ca);
        event.annotationAdded(ca);
      }
    }
  } catch (BadLocationException ex) {
    EclEmmaUIPlugin.log(ex);
  }
  fireModelChanged(event);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:23,代码来源:CoverageAnnotationModel.java


示例2: modelChanged

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
@Override
	public void modelChanged(AnnotationModelEvent event) {
//		if (event instanceof CompilationUnitAnnotationModelEvent) {
//			CompilationUnitAnnotationModelEvent cuEvent= (CompilationUnitAnnotationModelEvent) event;
//			if (cuEvent.includesProblemMarkerAnnotationChanges()) {
//				boolean hasChanges= false;
//				synchronized (this) {
//					IResource changedResource= cuEvent.getUnderlyingResource();
//					hasChanges= fResourcesWithAnnotationChanges.add(changedResource);
//				}
//				if (hasChanges) {
//					fireChanges();
//				}
//			}
//		}
	}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:17,代码来源:ProblemMarkerManager.java


示例3: fireModelChanged

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
private void fireModelChanged(AnnotationModelEvent event) {
  event.markSealed();
  if (!event.isEmpty()) {
    for (final IAnnotationModelListener l : annotationModelListeners) {
      if (l instanceof IAnnotationModelListenerExtension) {
        ((IAnnotationModelListenerExtension) l).modelChanged(event);
      } else {
        l.modelChanged(this);
      }
    }
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:13,代码来源:CoverageAnnotationModel.java


示例4: modelChanged

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
/**
 * @see IAnnotationModelListenerExtension#modelChanged(AnnotationModelEvent)
 */
public void modelChanged(AnnotationModelEvent event) {
	Object[] listeners= fListenerList.getListeners();
	for (int i= 0; i < listeners.length; i++) {
		Object curr= listeners[i];
		if (curr instanceof IAnnotationModelListenerExtension) {
			((IAnnotationModelListenerExtension) curr).modelChanged(event);
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:13,代码来源:CompilationUnitDocumentProvider.java


示例5: modelChanged

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
public void modelChanged(AnnotationModelEvent event) {
	if (event instanceof CompilationUnitAnnotationModelEvent) {
		CompilationUnitAnnotationModelEvent cuEvent= (CompilationUnitAnnotationModelEvent) event;
		if (cuEvent.includesProblemMarkerAnnotationChanges()) {
			boolean hasChanges= false;
			synchronized (this) {
				IResource changedResource= cuEvent.getUnderlyingResource();
				hasChanges= fResourcesWithAnnotationChanges.add(changedResource);
			}
			if (hasChanges) {
				fireChanges();
			}
		}
	}
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:16,代码来源:ProblemMarkerManager.java


示例6: modelChanged

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
@Override
public void modelChanged(AnnotationModelEvent event) {
    if (!event.isValid()) {
        return;
    }

    if (event.isWorldChange()) {
        update();
        return;
    }

    Annotation[] annotations = event.getAddedAnnotations();
    int length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

    annotations = event.getRemovedAnnotations();
    length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

    annotations = event.getChangedAnnotations();
    length = annotations.length;
    for (int i = 0; i < length; i++) {
        if (!skip(annotations[i].getType())) {
            update();
            return;
        }
    }

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:40,代码来源:CopiedOverviewRuler.java


示例7: clear

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
private void clear() {
  AnnotationModelEvent event = new AnnotationModelEvent(this);
  clear(event);
  fireModelChanged(event);
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:6,代码来源:CoverageAnnotationModel.java


示例8: addAnnotationModelListener

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
public void addAnnotationModelListener(IAnnotationModelListener listener) {
  if (!annotationModelListeners.contains(listener)) {
    annotationModelListeners.add(listener);
    fireModelChanged(new AnnotationModelEvent(this, true));
  }
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:7,代码来源:CoverageAnnotationModel.java


示例9: setSentenceTranslation

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
/**
 * Sets the sentence translation.
 *
 * @param sentence the new sentence translation
 */
private AnnotationModelEvent setSentenceTranslation(BTSSenctence sentence, boolean postSelection) {
	// TODO: allow for multiple sentence translations to be highlighted simultaneously
	// i.e. create method setSentenceTranslation(List<BTSSentence>) which gets passed
	// a Collection containing all sentences detected within a BTSTextSelectionEvent
	final AnnotationModelEvent ev = new AnnotationModelEvent(annotationModel);
	if (sentence != null && !sentence.equals(selectedSentence)) {
		selectedSentence = sentence;
		if (selectedSentence.getTranslation() == null) {
			Command command = AddCommand.create(editingDomain, selectedSentence,
					BtsCorpusModelPackage.BTS_SENCTENCE__TRANSLATION,
					BtsmodelFactory.eINSTANCE
					.createBTSTranslations());
			editingDomain.getCommandStack().execute(command);
		}
		sentenceTranslate_Editor.setEnabled(userMayEdit);
		sentenceTranslate_Editor.load(selectedSentence.getTranslation(),
				editingDomain, false);
		
		BTSModelAnnotation am = modelAnnotationMap.get(sentence.get_id());
		if (am != null)
		{
			if (!am.equals(highlightedSentenceAnnotation) || !am.getType().endsWith(".highlighted")) {
				// highlight current translation
				am.setHighlighted(true);
				ev.annotationChanged(am);
				// remove previous highlight
				if (highlightedSentenceAnnotation != null) { 
					highlightedSentenceAnnotation.setHighlighted(false);
					ev.annotationChanged(highlightedSentenceAnnotation);
				}
				highlightedSentenceAnnotation = am;
			}
			if (!postSelection) {
				// make sure annotation is visible in text editor 
				Position pos = annotationModel.getPosition(am);
				if (pos != null)
					embeddedEditor.getViewer().revealRange(pos.getOffset(), pos.length);

				// In order to limit workload, only repaint text editor (including highlight of line(s)
				// containing this sentence) if method call seems to come from selection listener
				// in EgyTextTranslationPart. This is indicated by postSelection being false. 
				// (if postSelection is true, repaint has most likely already been invoked in processSelection)
				sync.asyncExec(new Runnable() {
					public void run() {
						// TODO this can be improved in order to reduce work load repainting large texts
						
						if (painter == null || embeddedEditor.getViewer().getTextWidget().isDisposed()) return;
						painter.modelChanged(ev);
						painter.paint(IPainter.INTERNAL);
						ruler.update();
						ruler.relayout();
						oruler.update();
						embeddedEditor.getViewer().getTextWidget().redraw();
					}
				});
				return null;
			}
			
		}
		
		if (postSelection)
			selectionService.setSelection(sentence);
		return ev;
	}
	return null;
}
 
开发者ID:cplutte,项目名称:bts,代码行数:72,代码来源:EgyTextEditorPart.java


示例10: createAnnotationModelEvent

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
@Override
protected AnnotationModelEvent createAnnotationModelEvent() {
	return new CompilationUnitAnnotationModelEvent(this, getResource());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:5,代码来源:CompilationUnitDocumentProvider.java


示例11: createAnnotationModelEvent

import org.eclipse.jface.text.source.AnnotationModelEvent; //导入依赖的package包/类
@Override
protected AnnotationModelEvent createAnnotationModelEvent() {
    return new CompilationUnitAnnotationModelEvent(this, getResource());
}
 
开发者ID:forcedotcom,项目名称:idecore,代码行数:5,代码来源:ApexDocumentProvider.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java CommandLine类代码示例发布时间:2022-05-23
下一篇:
Java MaskUtil类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap