本文整理汇总了Java中org.eclipse.wst.sse.ui.StructuredTextEditor类的典型用法代码示例。如果您正苦于以下问题:Java StructuredTextEditor类的具体用法?Java StructuredTextEditor怎么用?Java StructuredTextEditor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StructuredTextEditor类属于org.eclipse.wst.sse.ui包,在下文中一共展示了StructuredTextEditor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addPages
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
@Override
protected void addPages() {
try {
this.xmlEditor=new StructuredTextEditor();
graphicalEditorPage=new GraphicalEditorPage(xmlEditor);
this.addPage(0, graphicalEditorPage,this.getEditorInput());
this.setPageText(0, "流程图");
this.addPage(1, xmlEditor,this.getEditorInput());
deploymentPage=new DeploymentPage(this,graphicalEditorPage.getGraphicalViewer(),"部署");
this.addPage(2, deploymentPage);
this.setPageText(1, "源码");
this.setActivePage(0);
this.setPartName(this.getEditorInput().getName());
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例2: setActivePage
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
@Override
public void setActivePage(IEditorPart activeEditor) {
IActionBars actionBars = getActionBars();
if (actionBars == null) return;
actionBars.clearGlobalActionHandlers();
if (activeEditor instanceof GraphicalEditorPage) {
addGraphicalEditorActions((GraphicalEditorPage) activeEditor, actionBars);
} else if (activeEditor instanceof StructuredTextEditor) {
addXmlEditorActions((StructuredTextEditor) activeEditor, actionBars);
}
actionBars.updateActionBars();
}
示例3: addXmlEditorActions
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
private void addXmlEditorActions(StructuredTextEditor activeEditor,
IActionBars actionBars) {
// set the global actions of jpdl editor are unable.
String[] keys = actionMap.keySet().toArray(new String[actionMap.keySet().size()]);
for (int i = 0; i < keys.length; i++) {
actionBars.setGlobalActionHandler(keys[i], null);
}
//set the global actions to xml editor global action
for (int i = 0; i < WORKBENCH_ACTION_IDS.length; i++) {
actionBars.setGlobalActionHandler(WORKBENCH_ACTION_IDS[i],activeEditor.getAction(TEXTEDITOR_ACTION_IDS[i]));
}
}
示例4: createPage0
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
void createPage0() {
try {
editor = new StructuredTextEditor();
int index = addPage(editor, getEditorInput());
setPageText(index, editor.getTitle());
}
catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus());
}
}
示例5: addPages
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
@Override
protected void addPages() {
this.jsonEditor = new StructuredTextEditor();
jsonEditor.setEditorPart(this);
try {
// Add pages like overview, etc
doAddPages();
// Add source page
jsonEditorIndex = addPage(jsonEditor, getEditorInput());
setPageText(jsonEditorIndex, "Source");
} catch (PartInitException e) {
e.printStackTrace();
}
}
示例6: getActiveTextViewer
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
/**
* @return the active structured text viewer, or null
*/
public static StructuredTextViewer getActiveTextViewer() {
// Need to get the workbench window from the UI thread
final IWorkbenchWindow[] windowHolder = new IWorkbenchWindow[1];
Display.getDefault().syncExec(new Runnable() {
public void run() {
windowHolder[0] = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
});
IWorkbenchWindow window = windowHolder[0];
if (window == null) {
return null;
}
IWorkbenchPage page = window.getActivePage();
if (page == null) {
return null;
}
IEditorPart editor = page.getActiveEditor();
if (editor == null) {
return null;
}
/*
* TODO: change the following to use AdapterUtilities.getAdapter()
* and either a) have GWTD register an adapter factory or b) add a direct
* IAdaptable.getAdapter() call to AdapterUtilities.getAdapter().
*/
StructuredTextEditor structuredEditor = (StructuredTextEditor) editor.getAdapter(StructuredTextEditor.class);
if (structuredEditor == null) {
return null;
}
return structuredEditor.getTextViewer();
}
示例7: createBPMN2Page
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
private void createBPMN2Page() {
try {
bpmnEditor = new StructuredTextEditor();
int index = addPage(bpmnEditor, getBPMN2EditorInput());
setPageText(index, ActivitiMultiPageEditor.XML_PANE_TITLE);
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested Activiti BPMN2.0 editor", null, e.getStatus());
}
}
示例8: createPageSource
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
/**
* Creates page 0 of the multi-page editor, which contains a text editor.
*/
void createPageSource() {
try {
editor = new StructuredTextEditor();
int index = addPage(editor, getEditorInput());
setPageText(index, "Source " + editor.getTitle());
setPageImage(index, ResourceManager.getPluginImage("org.eclipse.ui", "/icons/full/etool16/editor_area.png"));
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus());
}
}
示例9: createPage
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
void createPage(final String inputString, final String title, final String tooltip) {
try {
if (title.equals(SyncopeView.TEMPLATE_FORMAT_HTML)) {
editor = new HTMLEditor();
} else {
editor = new StructuredTextEditor();
}
int index = addPage(editor, (IEditorInput) new TemplateEditorInput(inputString, title, tooltip));
setPageText(index, editor.getTitle());
} catch (final PartInitException e) {
ErrorDialog.openError(
getSite().getShell(), ERROR_NESTED_EDITOR, null, e.getStatus());
}
}
示例10: execute
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
@Override
public Object execute(final ExecutionEvent event) throws ExecutionException {
final IWorkbenchWindow workbenchWindow = HandlerUtil.getActiveWorkbenchWindowChecked(event);
final IWorkbenchPage activePage = workbenchWindow.getActivePage();
if (null == activePage) {
throw new ExecutionException("No active page found while executing " + event.getCommand().getId()); //$NON-NLS-1$
}
final IEditorPart activeEditor = activePage.getActiveEditor();
if (null == activeEditor) {
throw new ExecutionException("No active editor found while executing " + event.getCommand().getId()); //$NON-NLS-1$
}
if (!VisualForceMultiPageEditor.class.isInstance(activeEditor)) {
throw new ExecutionException("Incorrect type for active editor found while executing " //$NON-NLS-1$
+ event.getCommand().getId()
+ ", expected " + VisualForceMultiPageEditor.class.getName() //$NON-NLS-1$
+ " found " + activeEditor.getClass().getName()); //$NON-NLS-1$
}
final VisualForceMultiPageEditor ourEditor = (VisualForceMultiPageEditor) activeEditor;
final StructuredTextEditor textEditor = ourEditor.getTextEditor();
if (null == textEditor) {
throw new ExecutionException("No text editor found while executing " + event.getCommand().getId()); //$NON-NLS-1$
}
final SnippetDialog snippetDialog = new SnippetDialog(textEditor.getSite().getShell(), textEditor);
snippetDialog.setSnippetDialogController(new SnippetDialogController());
snippetDialog.setProject(ourEditor.getEditorInputFile().getProject());
snippetDialog.open();
return null;
}
示例11: createMetadataPage
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
protected void createMetadataPage() {
metadataEditor = new StructuredTextEditor();
metadataEditor.setEditorPart(this);
if (metadataPropertyListener == null) {
metadataPropertyListener = new PropertyListener();
}
metadataEditor.addPropertyListener(metadataPropertyListener);
}
示例12: createPage0
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
/**
* Creates Structured Twext Editot of the multi-page editor, which contains an HTML editor.
*/
void createPage0() {
try {
textEditor = new StructuredTextEditor();
int index = addPage(textEditor, getEditorInput());
setPageText(index, "Source");
setPartName(textEditor.getTitle());
} catch (PartInitException e) {
ErrorDialog.openError(getSite().getShell(), "Error creating nested text editor", null, e.getStatus());
}
}
示例13: GraphicalEditorPage
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
public GraphicalEditorPage(StructuredTextEditor xmlEditor){
this.setEditDomain(new DefaultEditDomain(this));
this.xmlEditor=xmlEditor;
}
示例14: createMetadataPage
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
private void createMetadataPage() {
metadataEditor = new StructuredTextEditor();
metadataEditor.setEditorPart(this);
}
示例15: getMetadataEditor
import org.eclipse.wst.sse.ui.StructuredTextEditor; //导入依赖的package包/类
public StructuredTextEditor getMetadataEditor() {
return metadataEditor;
}