blob: 46ef27bbaaab65803b041ef42b561752ac87cb70 [file] [log] [blame]
/*******************************************************************************
* Copyright (c) 2004, 2007 Boeing.
* 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:
* Boeing - initial API and implementation
*******************************************************************************/
package org.eclipse.osee.framework.ui.skynet.Import;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IConfigurationElement;
/**
* @author Robert A. Fisher
*/
public abstract class WordOutlineContentHandler implements IWordOutlineContentHandler {
protected WordOutlineExtractor extractor;
private String name;
public WordOutlineContentHandler() {
this.extractor = null;
this.name = null;
}
/**
* Returns the name that was in the extension point. Clients may re-implement this method.
*/
public String getName() {
if (name == null) {
throw new IllegalStateException("Not yet initialized");
}
return name;
}
/**
* Setup the name from the extension point.
*/
public final void setInitializationData(IConfigurationElement config, String propertyName, Object data) throws CoreException {
name = config.getAttribute("name");
if (name == null || name.equals("")) {
name = "<no name>";
}
}
/**
* Get rid of references setup in init. Subclasses should extend this method if any other resources should be
* released.
*/
public void dispose() {
extractor = null;
}
/**
* Save off references. Subclasses should extend this method if anyother resources need to be setup.
*/
public void init(WordOutlineExtractor extractor) {
this.extractor = extractor;
}
}