本文整理匯總了Java中org.eclipse.jface.text.source.Annotation.setText方法的典型用法代碼示例。如果您正苦於以下問題:Java Annotation.setText方法的具體用法?Java Annotation.setText怎麽用?Java Annotation.setText使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.text.source.Annotation
的用法示例。
在下文中一共展示了Annotation.setText方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == de.darwinspl.preferences.resource.dwprofile.ui.DwprofilePositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例2: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.feature.expression.resource.hyexpression.ui.HyexpressionPositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例3: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.context.contextValidity.resource.hyvalidityformula.ui.HyvalidityformulaPositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例4: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.dataValues.resource.hydatavalue.ui.HydatavaluePositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例5: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.feature.mapping.resource.hymapping.ui.HymappingPositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例6: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.feature.constraint.resource.hyconstraints.ui.HyconstraintsPositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}
示例7: addAnnotation
import org.eclipse.jface.text.source.Annotation; //導入方法依賴的package包/類
protected void addAnnotation(IDocument document, eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPositionCategory type, String text, int offset, int length) {
// for declarations and occurrences we do not need to add the position to the
// document
Position position = positionHelper.createPosition(offset, length);
// instead, an annotation is created
Annotation annotation = new Annotation(false);
if (type == eu.hyvar.mspl.manifest.resource.hymanifest.ui.HymanifestPositionCategory.DEFINITION) {
annotation.setText("Declaration of " + text);
annotation.setType(DECLARATION_ANNOTATION_ID);
} else {
annotation.setText("Occurrence of " + text);
annotation.setType(OCCURRENCE_ANNOTATION_ID);
}
getSourceViewer().getAnnotationModel().addAnnotation(annotation, position);
}