Examples of IElementFactory


Examples of com.gargoylesoftware.htmlunit.html.IElementFactory

            return new DomText(page, source.getNodeValue());
        }
        final String ns = source.getNamespaceURI();
        String localName = source.getLocalName();
        if (HTMLParser.XHTML_NAMESPACE.equals(ns)) {
            final IElementFactory factory = HTMLParser.getFactory(localName);
            return factory.createElementNS(page, ns, localName, namedNodeMapToSaxAttributes(source.getAttributes()));
        }
        final Map<String, DomAttr> attributes = new HashMap<String, DomAttr>();
        final NamedNodeMap nodeAttributes = source.getAttributes();
        for (int i = 0; i < nodeAttributes.getLength(); i++) {
            final Attr attribute = (Attr) nodeAttributes.item(i);
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

        StringReader reader = new StringReader(xmlString);

        // Restore the editor input
        XMLMemento memento = XMLMemento.createReadRoot(reader);

        IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(
                factoryId);

        if (factory != null) {
            IAdaptable adaptable = factory.createElement(memento);
            if (adaptable != null && (adaptable instanceof IEditorInput)) {
                return new EditorInputData(editorId, (IEditorInput) adaptable);
            }
        }
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

            // if the factory id was not set in the memento
            // then assume that the memento was created using
            // IMemento.saveState, and should be restored using WorkingSetFactory
            factoryID = AbstractWorkingSet.FACTORY_ID;
        }
        IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(
                factoryID);
        if (factory == null) {
            WorkbenchPlugin
                    .log("Unable to restore working set - cannot instantiate factory: " + factoryID); //$NON-NLS-1$
            return null;
        }
        IAdaptable adaptable = factory.createElement(memento);
        if (adaptable == null) {
            WorkbenchPlugin
                    .log("Unable to restore working set - cannot instantiate working set: " + factoryID); //$NON-NLS-1$
            return null;
        }
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

        if (memento == null) {
      return;
    }
        String factoryID = memento
                .getString(IWorkbenchConstants.TAG_FACTORY_ID);
        IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(
                factoryID);
        if (factory != null) {
            IAdaptable element = factory.createElement(memento);
            if (element instanceof IEditorInput) {
                editorInput = (IEditorInput) element;
                editorID = memento.getString(IWorkbenchConstants.TAG_ID);
            }
        }
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

        if (UIStats.isDebugging(UIStats.CREATE_PART_INPUT)) {
            label = getName() != null ? getName() : factoryID;
        }
        try {
            UIStats.start(UIStats.CREATE_PART_INPUT, label);
            IElementFactory factory = PlatformUI.getWorkbench()
                    .getElementFactory(factoryID);
            if (factory == null) {
                throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_bad_element_factory, new Object[] { factoryID, getId(), getName() }));
            }

            // Get the input element.
            input = factory.createElement(inputMem);
            if (input == null) {
                throw new PartInitException(NLS.bind(WorkbenchMessages.EditorManager_create_element_returned_null, new Object[] { factoryID, getId(), getName() }));
            }
        } finally {
            UIStats.end(UIStats.CREATE_PART_INPUT, input, label);
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

            WorkbenchPlugin.log("Unable to find element factory: " + targetID); //$NON-NLS-1$
            return null;
        }

        // Create the extension.
        IElementFactory factory = null;
        try {
            factory = (IElementFactory) createExtension(targetElement, "class"); //$NON-NLS-1$
        } catch (CoreException e) {
            // log it since we cannot safely display a dialog.
            WorkbenchPlugin.log(
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

      if (factoryID == null) {
        WorkbenchPlugin
            .log("Unable to restore working set item - no factory ID."); //$NON-NLS-1$
        continue;
      }
      IElementFactory factory = PlatformUI.getWorkbench()
          .getElementFactory(factoryID);
      if (factory == null) {
        WorkbenchPlugin
            .log("Unable to restore working set item - cannot instantiate factory: " + factoryID); //$NON-NLS-1$
        continue;
      }
      IAdaptable item = factory.createElement(itemMemento);
      if (item == null) {
        WorkbenchPlugin
            .log("Unable to restore working set item - cannot instantiate item: " + factoryID); //$NON-NLS-1$
        continue;
      }
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

              "WorkbenchPageFactory"); //$NON-NLS-1$
          StartupThreading
              .runWithoutExceptions(new StartupRunnable() {

                public void runWithException() throws Throwable {
                  IElementFactory factory = PlatformUI
                      .getWorkbench().getElementFactory(
                          factoryID);
                  if (factory == null) {
                    WorkbenchPlugin
                        .log("Unable to restore page - cannot instantiate input factory: " + factoryID); //$NON-NLS-1$
                    result
                        .add(unableToRestorePage(pageMem));
                    return;
                  }

                  // Get the input element.
                  input[0] = factory.createElement(inputMem);
                }
              });
         
          if (input[0] == null) {
            WorkbenchPlugin
View Full Code Here

Examples of org.eclipse.ui.IElementFactory

        if (factoryId == null) {
            WorkbenchPlugin
                    .log("Unable to restore mru list - no input factory ID.");//$NON-NLS-1$
            return result;
        }
        IElementFactory factory = PlatformUI.getWorkbench().getElementFactory(
                factoryId);
        if (factory == null) {
            return result;
        }
        IMemento persistableMemento = memento
                .getChild(IWorkbenchConstants.TAG_PERSISTABLE);
        if (persistableMemento == null) {
            WorkbenchPlugin
                    .log("Unable to restore mru list - no input element state: " + factoryId);//$NON-NLS-1$
            return result;
        }
        IAdaptable adaptable = factory.createElement(persistableMemento);
        if (adaptable == null || (adaptable instanceof IEditorInput) == false) {
            return result;
        }
        input = (IEditorInput) adaptable;
        // Get the editor descriptor.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.