[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.webtools] Embedding wst/sse xml editor into a Composite

I would like to use the existing XML editor from SSE/WTP inside my custom editor part.

I would like to use the existing ability to:
Validate the XML with DTD's etc...
Use existing code assists/templates
syntax color highlighting

I would like avoid:
Re-implementing all of the above features.

Is there a direction I can go that someone can recommend?
Thanks,
Dave

I have attached a sample of what the UI might look like in .gif format.


The use of the XML editor could hopefully be something like this below:

	Composite container = new Composite(parent, SWT.NONE);
	container.setLayout(new GridLayout());

	final SashForm sashForm = new SashForm(container, SWT.VERTICAL);
	sashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	// I would like to use eclipses editor in this fashion.
	final XmlTextEditor xmlEditor = new XmlTextEditor(sashForm, SWT.BORDER);

	final TreeViewer treeViewer = new TreeViewer(sashForm, SWT.BORDER);
	treeViewer.addPostSelectionChangedListener(new ISelectionChangedListener() {
		public void selectionChanged(final SelectionChangedEvent event) {
			// Set the contents of the XML Editor
			xmlEditor.setInput(getEditorInput());
		}
	});

	final CTabFolder tabFolder = new CTabFolder(sashForm, SWT.BOTTOM);

	final CTabItem designTabItem = new CTabItem(tabFolder, SWT.NONE);
	designTabItem.setText("Design");

	tree_1 = new Tree(tabFolder, SWT.BORDER);
	designTabItem.setControl(tree_1);

	final CTabItem sourceTabItem = new CTabItem(tabFolder, SWT.NONE);
	sourceTabItem.setText("Source");

	styledText_1 = new StyledText(tabFolder, SWT.BORDER);
	sourceTabItem.setControl(styledText_1);
	sashForm.setWeights(new int[] {1, 1, 1 });

Attachment: CustomEditor.gif
Description: GIF image