Search in sources :

Example 1 with InputContext

use of com.liferay.ide.ui.editor.InputContext in project liferay-ide by liferay.

the class IDEFormEditor method gotoMarker.

/**
 * @return
 */
public void gotoMarker(IMarker marker) {
    IResource resource = marker.getResource();
    InputContext context = fInputContextManager.findContext(resource);
    if (context == null) {
        return;
    }
    IFormPage page = getActivePageInstance();
    if (!context.getId().equals(page.getId())) {
        page = setActivePage(context.getId());
    }
    IDE.gotoMarker(page, marker);
}
Also used : InputContext(com.liferay.ide.ui.editor.InputContext) IFormPage(org.eclipse.ui.forms.editor.IFormPage) IResource(org.eclipse.core.resources.IResource)

Example 2 with InputContext

use of com.liferay.ide.ui.editor.InputContext in project liferay-ide by liferay.

the class IDEFormEditor method _validateEdit.

private void _validateEdit(IEditorInput input) {
    InputContext context = fInputContextManager.getContext(input);
    if (!context.validateEdit()) {
        IWorkbenchPartSite site = getSite();
        Shell shell = site.getShell();
        shell.getDisplay().asyncExec(new Runnable() {

            public void run() {
                doRevert(context.getInput());
                context.setValidated(false);
            }
        });
    }
}
Also used : IWorkbenchPartSite(org.eclipse.ui.IWorkbenchPartSite) Shell(org.eclipse.swt.widgets.Shell) InputContext(com.liferay.ide.ui.editor.InputContext)

Aggregations

InputContext (com.liferay.ide.ui.editor.InputContext)2 IResource (org.eclipse.core.resources.IResource)1 Shell (org.eclipse.swt.widgets.Shell)1 IWorkbenchPartSite (org.eclipse.ui.IWorkbenchPartSite)1 IFormPage (org.eclipse.ui.forms.editor.IFormPage)1