本文整理了Java中org.dadacoalition.yedit.editor.YEdit
类的一些代码示例,展示了YEdit
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YEdit
类的具体详情如下:
包路径:org.dadacoalition.yedit.editor.YEdit
类名称:YEdit
暂无
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
public void addDocumentIdleListener(IDocumentIdleListener listener) {
super.addDocumentIdleListener(listener);
}
代码示例来源:origin: oyse/yedit
/**
* Re-initialize the editor after changes have been done to the preferences.
*/
void reinitialize(){
if( getSourceViewer() instanceof SourceViewer){
((SourceViewer) getSourceViewer()).unconfigure();
initializeEditor();
getSourceViewer().configure(sourceViewerConfig);
} else {
String msg = "Expected source viewer to be of type SourceViewer, but is wasn't. ";
msg += "Might cause problems with preferences.";
YEditLog.logger.warning(msg);
}
}
代码示例来源:origin: oyse/yedit
protected void initializeEditor() {
super.initializeEditor();
YEditSourceViewerConfiguration jsvc = createSourceViewerConfiguration();
setSourceViewerConfiguration(jsvc);
sourceViewerConfig = jsvc;
}
代码示例来源:origin: oyse/yedit
public void createPartControl(Composite parent) {
super.createPartControl(parent);
idleTimer = new IdleTimer(getSourceViewer(), Display.getCurrent());
idleTimer.start();
IDocumentIdleListener listener = new IDocumentIdleListener(){
public void editorIdle( ISourceViewer sourceViewer ){
sourceViewer.invalidateTextPresentation();
}
};
addDocumentIdleListener(listener);
Activator.getDefault().getPreferenceStore().addPropertyChangeListener(propertyChangeListener);
}
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
protected void initializeEditor() {
super.initializeEditor();
setHelpContextId(CONTEXT);
setSourceViewerConfiguration(createSourceViewerConfiguration());
}
代码示例来源:origin: oyse/yedit
IEditorInput editorInput = this.getEditorInput();
markerSeverity = IMarker.SEVERITY_WARNING;
YAMLException syntaxError = checkForErrors();
代码示例来源:origin: oyse/yedit
public Object execute(ExecutionEvent event) throws ExecutionException {
YEditLog.logger.fine("FormatDocumentHandler executed");
IEditorPart editorPart = HandlerUtil.getActiveEditor(event);
if( editorPart instanceof YEdit ){
YEdit yedit = (YEdit) editorPart;
yedit.formatDocument();
} else {
YEditLog.logger.warning("Expected the active editor to be YEdit, but it wasn't");
}
return null;
}
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
public void dispose() {
// preference store is removed in AbstractTextEditor.dispose()
getPreferenceStore().removePropertyChangeListener(preferenceChangeListener);
super.dispose();
}
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
@SuppressWarnings("rawtypes")
public Object getAdapter(Class required) {
Object adapter = super.getAdapter(required);
if (IContentOutlinePage.class.equals(required)) {
if (contentOutline == null) {
contentOutline = new JsonContentOutlinePage(getDocumentProvider(), this);
if (getEditorInput() != null) {
contentOutline.setInput(getEditorInput());
}
}
adapter = contentOutline;
}
return adapter;
}
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
protected void doSetInput(IEditorInput input) throws CoreException {
if (input != null) {
super.doSetInput(input);
IDocument document = getDocumentProvider().getDocument(getEditorInput());
if (document != null) {
document.addDocumentListener(changeListener);
// validate content before editor opens
runValidate(true);
}
}
}
代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor
@Override
public void createPartControl(Composite parent) {
super.createPartControl(parent);
ProjectionViewer viewer = getProjectionViewer();
projectionSupport = new ProjectionSupport(viewer, getAnnotationAccess(), getSharedColors());
projectionSupport.install();
// turn projection mode on
viewer.doOperation(ProjectionViewer.TOGGLE);
annotationModel = viewer.getProjectionAnnotationModel();
getPreferenceStore().addPropertyChangeListener(preferenceChangeListener);
}
代码示例来源:origin: oyse/yedit
public void createControl(Composite parent) {
super.createControl(parent);
IPreferenceStore prefs = Activator.getDefault().getPreferenceStore();
int expandLevels = TreeViewer.ALL_LEVELS;
if( !(prefs.getBoolean(PreferenceConstants.AUTO_EXPAND_OUTLINE) ) ){
expandLevels = 0;
}
TreeViewer viewer= getTreeViewer();
viewer.setContentProvider(new ContentProvider());
viewer.setLabelProvider( new YEditStyledLabelProvider( yamlEditor.getColorManager() ) );
viewer.addSelectionChangedListener(this);
viewer.setAutoExpandLevel(expandLevels);
if (input != null){
setInput(input);
}
}
内容来源于网络,如有侵权,请联系作者删除!