* disposed when releaseView is called an equal number of times
* to createView.
*/
public IViewReference createView(String id, String secondaryId)
throws PartInitException {
IViewDescriptor desc = viewReg.find(id);
// ensure that the view id is valid
if (desc == null) {
throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_couldNotCreate, id ));
}
// ensure that multiple instances are allowed if a secondary id is given
if (secondaryId != null) {
if (!desc.getAllowMultiple()) {
throw new PartInitException(NLS.bind(WorkbenchMessages.ViewFactory_noMultiple, id));
}
}
String key = getKey(id, secondaryId);
IViewReference ref = (IViewReference) counter.get(key);