Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
 
 package org.eclipse.pde.internal.ua.ui.editor.ctxhelp;
 
 import java.io.File;
 
The input context for the context help editor, based on an xml file containing help context ids.

Since:
3.4
 
 public class CtxHelpInputContext extends XMLInputContext {
 
 	public static final String CONTEXT_ID = "ctxhelp-context"//$NON-NLS-1$	
 
 	public CtxHelpInputContext(PDEFormEditor editorIEditorInput inputboolean primary) {
 		super(editorinputprimary);
 		create();
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.context.InputContext#createModel(org.eclipse.ui.IEditorInput)
 	 */
 	protected IBaseModel createModel(IEditorInput inputthrows CoreException {
 		if (input instanceof IStorageEditorInput) {
 			boolean isReconciling = input instanceof IFileEditorInput;
 			IDocument document = getDocumentProvider().getDocument(input);
 
 			CtxHelpModel model = new CtxHelpModel(documentisReconciling);
 
 			if (input instanceof IFileEditorInput) {
 				IFile file = ((IFileEditorInputinput).getFile();
 				model.setUnderlyingResource(file);
 				model.setCharset(file.getCharset());
 			} else if (input instanceof IURIEditorInput) {
 				IFileStore store = EFS.getStore(((IURIEditorInputinput).getURI());
 			} else if (input instanceof JarEntryEditorInput) {
 				File file = (File) ((JarEntryEditorInputinput).getAdapter(File.class);
 				model.setInstallLocation(file.toString());
 			} else {
 			}
 
 			model.load();
 
 			return model;
 		}
 
 		return null;
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.context.InputContext#getId()
 	 */
 	public String getId() {
 		return ;
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.context.XMLInputContext#reorderInsertEdits(java.util.ArrayList)
 	 */
 	protected void reorderInsertEdits(ArrayList ops) {
 		// NO-OP
 	}
 
 	/* (non-Javadoc)
 	 * @see org.eclipse.pde.internal.ui.editor.context.InputContext#doRevert()
 	 */
 	public void doRevert() {
 		// TODO we should move this up the stack....
		model.reconciled(model.getDocument());
	}
	/* (non-Javadoc)
	 * @see org.eclipse.pde.internal.ui.editor.context.InputContext#getPartitionName()
	 */
	protected String getPartitionName() {
		return "___ctxhelp_partition"//$NON-NLS-1$
	}
New to GrepCode? Check out our FAQ X