X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java index 77aa1b4..93639a6 100644 --- a/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java +++ b/net.sourceforge.phpeclipse.smarty.ui/src/net/sourceforge/phpdt/smarty/ui/internal/editor/SmartyEditor.java @@ -8,7 +8,7 @@ * Contributors: * Christopher Lenz - initial implementation * - * $Id: SmartyEditor.java,v 1.1 2004-09-03 17:31:18 jsurfer Exp $ + * $Id: SmartyEditor.java,v 1.2 2006-10-21 23:19:32 pombredanne Exp $ */ package net.sourceforge.phpdt.smarty.ui.internal.editor; @@ -24,33 +24,31 @@ import org.eclipse.jface.action.IAction; import org.eclipse.ui.texteditor.ContentAssistAction; import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds; - /** * HTML editor implementation. */ public class SmartyEditor extends XMLEditor { - public SmartyEditor() { - super(ShowExternalPreviewAction.SMARTY_TYPE); - } + public SmartyEditor() { + super(ShowExternalPreviewAction.SMARTY_TYPE); + } + // Instance Variables ------------------------------------------------------ - - /** The associated preview page. */ -// private HTMLPreviewPage previewPage; + /** The associated preview page. */ + // private HTMLPreviewPage previewPage; // XMLEditor Implementation ------------------------------------------------ - - /* + /* * @see org.eclipse.core.runtime.IAdaptable#getAdapter(Class) */ public Object getAdapter(Class adapter) { -// if (adapter == IBrowserPreviewPage.class) { -// if (previewPage == null) { -// previewPage = createPreviewPage(); -// } -// return previewPage; -// } + // if (adapter == IBrowserPreviewPage.class) { + // if (previewPage == null) { + // previewPage = createPreviewPage(); + // } + // return previewPage; + // } return super.getAdapter(adapter); } @@ -59,36 +57,37 @@ public class SmartyEditor extends XMLEditor { /** * Creates the HTML preview page. */ -// private HTMLPreviewPage createPreviewPage() { -// IEditorInput input = getEditorInput(); -// if (input instanceof IFileEditorInput) { -// IFile file = ((IFileEditorInput) input).getFile(); -// try { -// URL location = file.getLocation().toFile().toURL(); -// return new HTMLPreviewPage(location); -// } catch (MalformedURLException e) { } -// } -// return null; -// } + // private HTMLPreviewPage createPreviewPage() { + // IEditorInput input = getEditorInput(); + // if (input instanceof IFileEditorInput) { + // IFile file = ((IFileEditorInput) input).getFile(); + // try { + // URL location = file.getLocation().toFile().toURL(); + // return new HTMLPreviewPage(location); + // } catch (MalformedURLException e) { } + // } + // return null; + // } protected void createActions() { super.createActions(); - IAction action = new ContentAssistAction(SmartyEditorMessages.getResourceBundle(), - "ContentAssistProposal.", this); //$NON-NLS-1$ - action - .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); - setAction("ContentAssistProposal", action); //$NON-NLS-1$ - markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ - -// IAction action= new TextOperationAction( -// TemplateMessages.getResourceBundle(), -// "Editor." + TEMPLATE_PROPOSALS + ".", //$NON-NLS-1$ //$NON-NLS-2$ -// this, -// ISourceViewer.CONTENTASSIST_PROPOSALS); -// action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); -// setAction(TEMPLATE_PROPOSALS, action); -// markAsStateDependentAction(TEMPLATE_PROPOSALS, true); + IAction action = new ContentAssistAction(SmartyEditorMessages + .getResourceBundle(), "ContentAssistProposal.", this); //$NON-NLS-1$ + action + .setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + setAction("ContentAssistProposal", action); //$NON-NLS-1$ + markAsStateDependentAction("ContentAssistProposal", true); //$NON-NLS-1$ + + // IAction action= new TextOperationAction( + // TemplateMessages.getResourceBundle(), + // "Editor." + TEMPLATE_PROPOSALS + ".", //$NON-NLS-1$ //$NON-NLS-2$ + // this, + // ISourceViewer.CONTENTASSIST_PROPOSALS); + // action.setActionDefinitionId(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS); + // setAction(TEMPLATE_PROPOSALS, action); + // markAsStateDependentAction(TEMPLATE_PROPOSALS, true); } + /* * @see org.eclipse.ui.editors.text.TextEditor#initializeEditor() */