Java Code Examples for org.pentaho.ui.xul.swt.SwtBindingFactory#setDocument()

The following examples show how to use org.pentaho.ui.xul.swt.SwtBindingFactory#setDocument() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PartitionsController.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected boolean doLazyInit() {
  // Load the SWT Shell from the explorer dialog
  shell = ( (SwtDialog) document.getElementById( "repository-explorer-dialog" ) ).getShell();

  try {
    mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" );
  } catch ( XulException e ) {
    return false;
  }

  enableButtons( true, false, false );
  bf = new SwtBindingFactory();
  bf.setDocument( this.getXulDomContainer().getDocumentRoot() );

  if ( bf != null ) {
    createBindings();
  }

  return true;
}
 
Example 2
Source File: ClustersController.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected boolean doLazyInit() {
  try {
    // Load the SWT Shell from the explorer dialog
    mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" );
    shell = ( (SwtDialog) document.getElementById( "repository-explorer-dialog" ) ).getShell();
    bf = new SwtBindingFactory();
    bf.setDocument( this.getXulDomContainer().getDocumentRoot() );
    enableButtons( true, false, false );
    if ( bf != null ) {
      createBindings();
    }
    return true;
  } catch ( Exception e ) {
    if ( mainController == null || !mainController.handleLostRepository( e ) ) {
      return false;
    }

    return false;
  }
}
 
Example 3
Source File: SlavesController.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Override
protected boolean doLazyInit() {
  // Load the SWT Shell from the explorer dialog
  shell = ( (SwtDialog) document.getElementById( "repository-explorer-dialog" ) ).getShell();

  enableButtons( true, false, false );
  bf = new SwtBindingFactory();
  bf.setDocument( this.getXulDomContainer().getDocumentRoot() );

  try {
    mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" );
  } catch ( XulException e ) {
    return false;
  }

  if ( bf != null ) {
    createBindings();
  }

  return true;
}
 
Example 4
Source File: BrowseController.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@SuppressWarnings( "deprecation" )
public void init( Repository repository ) throws ControllerInitializationException {
  try {
    this.repository = repository;

    mainController = (MainController) this.getXulDomContainer().getEventHandler( "mainController" );

    RepositoryDirectoryInterface root;
    try {
      if ( repository instanceof RepositoryExtended ) {
        root = ( (RepositoryExtended) repository ).loadRepositoryDirectoryTree( false );
      } else {
        root = repository.loadRepositoryDirectoryTree();
      }
      this.repositoryDirectory =
        UIObjectRegistry.getInstance().constructUIRepositoryDirectory( root,
          null, repository );
    } catch ( UIObjectCreationException uoe ) {
      this.repositoryDirectory =
        new UIRepositoryDirectory( repository.loadRepositoryDirectoryTree(), null, repository );
    }
    this.repositoryDirectory.populateChildren();
    dirMap = new HashMap<ObjectId, UIRepositoryDirectory>();
    populateDirMap( repositoryDirectory );

    bf = new SwtBindingFactory();
    bf.setDocument( this.getXulDomContainer().getDocumentRoot() );
    messageBox = (XulMessageBox) document.createElement( "messagebox" );
    createBindings();
  } catch ( Exception e ) {
    throw new ControllerInitializationException( e );
  }
}
 
Example 5
Source File: MainController.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void init() {
  bf = new SwtBindingFactory();
  bf.setDocument( this.getXulDomContainer().getDocumentRoot() );
  createBindings();

  if ( dialog != null && repository != null ) {
    dialog.setTitle( BaseMessages.getString( PKG, "RepositoryExplorerDialog.DevTitle", repository.getName() ) );
  }
}