Search in sources :

Example 66 with StructuredTextEditor

use of org.eclipse.wst.sse.ui.StructuredTextEditor in project jbosstools-hibernate by jbosstools.

the class MultiPageEditorContributor method setActivePage.

public void setActivePage(IEditorPart activeEditor) {
    // check is added.
    if (multiPageEditor != null) {
        if (activeEditor != null && activeEditor instanceof StructuredTextEditor)
            activateSourcePage(activeEditor);
        else
            activateDesignPage(activeEditor);
    }
    updateToolbarActions();
    IActionBars actionBars = getActionBars();
    if (actionBars != null) {
        // update menu bar and tool bar
        actionBars.updateActionBars();
    }
}
Also used : StructuredTextEditor(org.eclipse.wst.sse.ui.StructuredTextEditor) IActionBars(org.eclipse.ui.IActionBars)

Example 67 with StructuredTextEditor

use of org.eclipse.wst.sse.ui.StructuredTextEditor in project jbosstools-hibernate by jbosstools.

the class ReverseEngineeringEditor method initSourcePage.

/*public void setActivePage(String string) {
		Integer number = (Integer) pageNameToIndex.get(string);
		if(number!=null) {
			setActivePage(number.intValue());
		}
	}*/
private void initSourcePage() {
    int pageCount = getPageCount();
    for (int i = 0; i < pageCount; i++) {
        if (getEditor(i) instanceof StructuredTextEditor) {
            sourcePage = (StructuredTextEditor) getEditor(i);
            IDOMDocument document = getDocument(sourcePage);
            definition = new DOMReverseEngineeringDefinition(document);
        }
    }
}
Also used : DOMReverseEngineeringDefinition(org.hibernate.eclipse.mapper.model.DOMReverseEngineeringDefinition) IDOMDocument(org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument) StructuredTextEditor(org.eclipse.wst.sse.ui.StructuredTextEditor)

Aggregations

StructuredTextEditor (org.eclipse.wst.sse.ui.StructuredTextEditor)67 IFile (org.eclipse.core.resources.IFile)29 IEditorPart (org.eclipse.ui.IEditorPart)28 StructuredTextViewer (org.eclipse.wst.sse.ui.internal.StructuredTextViewer)21 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)18 IDocument (org.eclipse.jface.text.IDocument)15 IWorkbenchWindow (org.eclipse.ui.IWorkbenchWindow)15 ITextEditor (org.eclipse.ui.texteditor.ITextEditor)12 Position (org.eclipse.jface.text.Position)11 ArrayList (java.util.ArrayList)10 List (java.util.List)10 BadLocationException (org.eclipse.jface.text.BadLocationException)9 ITextSelection (org.eclipse.jface.text.ITextSelection)6 PartInitException (org.eclipse.ui.PartInitException)6 XMLMultiPageEditorPart (org.eclipse.wst.xml.ui.internal.tabletree.XMLMultiPageEditorPart)6 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)4 Action (org.eclipse.jface.action.Action)4 Separator (org.eclipse.jface.action.Separator)4 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)3 IFileEditorInput (org.eclipse.ui.IFileEditorInput)3