private ModelerDialog(
     EmbeddedWizard wizard, final AsyncConstructorListener<ModelerDialog> constructorListener) {
   this.wizard = wizard;
   this.constructorListener = constructorListener;
   AsyncXulLoader.loadXulFromUrl(
       GWT.getModuleBaseURL() + "modeler.xul", GWT.getModuleBaseURL() + "modeler", this);
 }
  private void loadDatabaseOptionsFragment(
      String fragmentUri,
      final DataHandler dataHandler,
      final IDatabaseType database,
      final IFragmentHandler.Callback parentCallback)
      throws XulException {

    // clean out group before reloading
    XulComponent groupElement = document.getElementById("database-options-box"); // $NON-NLS-1$
    for (XulComponent component : groupElement.getChildNodes()) {
      groupElement.removeChild(component);
    }

    XulComponent parentElement = groupElement.getParent();
    XulDomContainer fragmentContainer = null;

    //    try {

    // Get new group box fragment ...
    // This will effectively set up the SWT parent child relationship...

    IXulLoaderCallback internalCallback =
        new IXulLoaderCallback() {
          public void overlayLoaded() {
            // TODO Auto-generated method stub
            afterOverlay(dataHandler, database);
            if (parentCallback != null) {
              parentCallback.callback();
            }
          }

          public void overlayRemoved() {}

          public void xulLoaded(GwtXulRunner runner) {}
        };

    // this call will cache the individual overlays in a map within AsyncXulLoader
    AsyncXulLoader.loadOverlayFromUrl(
        GWT.getModuleBaseURL() + fragmentUri,
        GWT.getModuleBaseURL() + "databasedialog",
        (GwtXulDomContainer) getXulDomContainer(),
        internalCallback,
        true);

    //      fragmentContainer = this.xulDomContainer.loadFragment(fragmentUri, (Object)null);
    // //messages.getBundle());
    //      XulComponent newGroup = fragmentContainer.getDocumentRoot().getFirstChild();
    //      parentElement.replaceChild(groupElement, newGroup);

    //    } catch (XulException e) {
    //      e.printStackTrace();
    //      throw e;
    //    }

    //    if (fragmentContainer == null){
    //      return;
    //    }

  }
示例#3
0
 public void loadOverlays(List<MantleXulOverlay> overlays) {
   for (MantleXulOverlay overlay : overlays) {
     overlayMap.put(overlay.getId(), overlay);
     if (overlay.getId().startsWith("startup")) {
       AsyncXulLoader.loadOverlayFromSource(
           overlay.getSource(), overlay.getResourceBundleUri(), container, this);
     }
   }
 }
示例#4
0
  protected XulMain(final SolutionBrowserPerspective solutionBrowser) {
    this.solutionBrowser = solutionBrowser;
    // instantiate our Model and Controller
    controller =
        new MainToolbarController(solutionBrowser, new MainToolbarModel(solutionBrowser, this));

    // Invoke the async loading of the XUL DOM.
    AsyncXulLoader.loadXulFromUrl("xul/main_toolbar.xul", "messages/mantleMessages", this);
    solutionBrowser.addSolutionBrowserListener(this);
    setStylePrimaryName("mainToolbar-Wrapper");
  }
示例#5
0
 public void removeOverlay(String id) {
   if (overlayMap != null && !overlayMap.isEmpty()) {
     if (overlayMap.containsKey(id)) {
       MantleXulOverlay overlay = overlayMap.get(id);
       AsyncXulLoader.removeOverlayFromSource(
           overlay.getOverlayXml(), overlay.getResourceBundleUri(), container, this);
     } else {
       // Should I log this or throw an exception here
     }
   }
 }