org.pentaho.ui.xul.binding.BindingFactory Java Examples

The following examples show how to use org.pentaho.ui.xul.binding.BindingFactory. 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: BaseStepGenericXulDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException {
  bf = bindingFactory;
  this.runner = runner;
  loader.registerClassLoader( getClass().getClassLoader() );
  loader.setSettingsManager( getSettingsManager() );
  loader.setOuterContext( parent );
  container = loader.loadXul( xulFile, getResourceBundle() );
  bf.setDocument( container.getDocumentRoot() );

  for ( XulEventHandler h : getEventHandlers() ) {
    container.addEventHandler( h );
  }

  this.runner.addContainer( container );

  // try and get the dialog
  xulDialog = (XulDialog) container.getDocumentRoot().getRootElement();
  runner.initialize();
}
 
Example #2
Source File: AbstractPreviewRowsXulDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void initializeXul( XulLoader loader, BindingFactory bindingFactory, XulRunner runner, Object parent ) throws XulException {

    bf = bindingFactory;
    this.runner = runner;

    loader.registerClassLoader( getClass().getClassLoader() );
    loader.setSettingsManager( getSettingsManager() );
    loader.setOuterContext( parent );

    container = loader.loadXul( xulFile, getResourceBundle() );

    bf.setDocument( container.getDocumentRoot() );

    for ( XulEventHandler h : getEventHandlers() ) {
      container.addEventHandler( h );
    }

    this.runner.addContainer( container );

    // try and get the dialog
    xulDialog = (XulDialog) container.getDocumentRoot().getRootElement();
    runner.initialize();
  }
 
Example #3
Source File: KerberosAuthProvider.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
protected void addBindings( List<Binding> bindings, BindingFactory bf ) {

  super.addBindings( bindings, bf );

  Binding b = bf.createBinding( this, "keytabFile", "keytab", "value" );
  b.setBindingType( Binding.Type.BI_DIRECTIONAL );
  bindings.add( b );

  b = bf.createBinding( this, "useKeytab", "useKeytab", "checked" );
  b.setBindingType( Binding.Type.BI_DIRECTIONAL );
  bindings.add( b );

  b = bf.createBinding( "useKeytab", "checked", "keytab", "!disabled" );
  b.setBindingType( Binding.Type.ONE_WAY );
  bindings.add( b );

  b = bf.createBinding( "useKeytab", "checked", "browse", "!disabled" );
  b.setBindingType( Binding.Type.ONE_WAY );
  bindings.add( b );

  b = bf.createBinding( "useKeytab", "checked", "password", "disabled" );
  b.setBindingType( Binding.Type.ONE_WAY );
  bindings.add( b );

  b = bf.createBinding( "useKeytab", "checked", "principal", "disabled" );
  b.setBindingType( Binding.Type.ONE_WAY );
  bindings.add( b );

}
 
Example #4
Source File: BasicAuthProvider.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Override
protected void addBindings( List<Binding> bindings, BindingFactory bf ) {

  Binding b = bf.createBinding( this, "password", "password", "value" );
  b.setBindingType( Binding.Type.BI_DIRECTIONAL );
  bindings.add( b );

}
 
Example #5
Source File: AbstractMqlEditor.java    From mql-editor with GNU Lesser General Public License v2.1 5 votes vote down vote up
private void init() {
  try {

    XulLoader loader = getLoader();
    loader.setOuterContext( parentWindow );
    container = loader.loadXul( "org/pentaho/commons/metadata/mqleditor/editor/xul/mainFrame.xul" );

    getRunner().addContainer( container );

    BindingFactory bf = new DefaultBindingFactory();
    bf.setDocument( container.getDocumentRoot() );

    mainController.setBindingFactory( bf );
    selectedColumnController.setBindingFactory( bf );
    constraintController.setBindingFactory( bf );
    orderController.setBindingFactory( bf );
    previewController.setBindingFactory( bf );

    container.addEventHandler( mainController );
    container.addEventHandler( selectedColumnController );
    container.addEventHandler( constraintController );
    container.addEventHandler( orderController );
    container.addEventHandler( previewController );

    mainController.setWorkspace( workspace );
    selectedColumnController.setWorkspace( workspace );
    constraintController.setWorkspace( workspace );
    orderController.setWorkspace( workspace );
    previewController.setWorkspace( workspace );

  } catch ( XulException e ) {
    log.error( "error loading Xul application", e );
  }
}
 
Example #6
Source File: AuthProviderControllerTest.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
@Before
public void setup() {

  BindingFactory bf = new SwtBindingFactory();
  controller = new AuthProviderController(  );
  controller.setResourceBundle( resourceBundle );
  providers = AuthHarness.getProviders( bf );

}
 
Example #7
Source File: StatusController.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #8
Source File: NoAuthAuthProvider.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public NoAuthAuthProvider( BindingFactory bf ) {
  super( bf );
}
 
Example #9
Source File: AbstractAuthProvider.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public AbstractAuthProvider( BindingFactory bf ) {
  this.bf = bf;
}
 
Example #10
Source File: KerberosAuthProvider.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public KerberosAuthProvider( BindingFactory bf ) {
  super( bf );
}
 
Example #11
Source File: BasicAuthProvider.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public BasicAuthProvider( BindingFactory bf ) {
  super( bf );
}
 
Example #12
Source File: AuthProviderDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public BindingFactory getBindingFactory() {
  return controller.getBindingFactory();
}
 
Example #13
Source File: AuthProviderController.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public BindingFactory getBindingFactory() {
  return bf;
}
 
Example #14
Source File: ExportHandler.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #15
Source File: AggController.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #16
Source File: MainController.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #17
Source File: AggListController.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #18
Source File: ConnectionController.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #19
Source File: AbstractMondrianSchemaProvider.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  bindingFactory.setDocument(document);
  this.bindingFactory = bindingFactory;
}
 
Example #20
Source File: MondrianFileSchemaProviderTest.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #21
Source File: XulSupressingBindingFactoryProxy.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
public void setProxiedBindingFactory(BindingFactory proxiedBindingFactory) {
  this.proxiedBindingFactory = proxiedBindingFactory;
}
 
Example #22
Source File: ConnectionControllerITest.java    From pentaho-aggdesigner with GNU General Public License v2.0 4 votes vote down vote up
@Autowired
public void setBindingFactory(BindingFactory bindingFactory) {
  this.bindingFactory = bindingFactory;
}
 
Example #23
Source File: AuthProviderController.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void setBindingFactory( BindingFactory bf ) {
  this.bf = bf;
}
 
Example #24
Source File: LinearWizardController.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public LinearWizardController( final WizardEditorModel editorModel,
                               final BindingFactory bf ) {
  this.steps = new ArrayList<WizardStep>();
  this.editorModel = editorModel;
  this.bf = bf;
}
 
Example #25
Source File: LinearWizardController.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void setBindingFactory( final BindingFactory bf ) {
  this.bf = bf;
}
 
Example #26
Source File: LinearWizardController.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public BindingFactory getBindingFactory() {
  return bf;
}
 
Example #27
Source File: AbstractWizardStep.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void setBindingFactory( final BindingFactory bf ) {
  this.bf = bf;
}
 
Example #28
Source File: AbstractWizardStep.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public BindingFactory getBindingFactory() {
  return bf;
}
 
Example #29
Source File: DefaultXulDrillDownController.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void init( final ReportDesignerContext reportDesignerContext,
                  final DrillDownModel model,
                  final String[] fields ) {
  if ( model == null ) {
    throw new NullPointerException();
  }
  if ( reportDesignerContext == null ) {
    throw new NullPointerException();
  }
  if ( fields == null ) {
    throw new NullPointerException();
  }

  this.reportDesignerContext = reportDesignerContext;

  final Document doc = this.xulDomContainer.getDocumentRoot();
  final DefaultBindingFactory bindingFactory = new DefaultBindingFactory();
  bindingFactory.setDocument( doc );
  bindingFactory.setBindingType( Binding.Type.BI_DIRECTIONAL );
  wrapper = new DrillDownModelWrapper( model );
  final XulComponent pathElement = doc.getElementById( "path" ); //NON-NLS
  if ( pathElement != null ) {
    bindingFactory.createBinding( wrapper, DrillDownModel.DRILL_DOWN_PATH_PROPERTY, "path", "value" ); //NON-NLS
  }
  final XulComponent configElement = doc.getElementById( "config" ); //NON-NLS
  if ( configElement != null ) {
    bindingFactory.createBinding( wrapper, DrillDownModel.DRILL_DOWN_CONFIG_PROPERTY, "config", "value" ); //NON-NLS
  }
  final XulComponent linkTargetElement = doc.getElementById( "link-target" ); //NON-NLS
  if ( linkTargetElement != null ) {
    bindingFactory.createBinding( wrapper, DrillDownModel.TARGET_FORMULA_PROPERTY, "link-target", "value" ); //NON-NLS
  }
  final XulComponent linkTooltipElement = doc.getElementById( "link-tooltip" ); //NON-NLS
  if ( linkTooltipElement != null ) {
    bindingFactory
      .createBinding( wrapper, DrillDownModel.TOOLTIP_FORMULA_PROPERTY, "link-tooltip", "value" ); //NON-NLS
  }
  final XulComponent previewElement = doc.getElementById( "preview" ); //NON-NLS
  if ( previewElement != null ) {
    final BindingFactory singleSourceBinding = new DefaultBindingFactory();
    singleSourceBinding.setBindingType( Binding.Type.ONE_WAY );
    singleSourceBinding.setDocument( doc );
    singleSourceBinding.createBinding( wrapper, "preview", "preview", "value" ); //NON-NLS
  }

  // we manage the binding between the table and the outside world manually
  wrapper.refresh();
  final XulComponent paramTableElement = doc.getElementById( "parameter-table" ); //NON-NLS
  if ( paramTableElement instanceof XulDrillDownParameterTable ) {
    final XulDrillDownParameterTable parameterTable = (XulDrillDownParameterTable) paramTableElement;
    table = parameterTable.getTable();
    table.setExtraFields( fields );
    table.setReportDesignerContext( reportDesignerContext );
    table.setDrillDownParameter( model.getDrillDownParameter() );
    table.setHideParameterUi( model.getDrillDownConfig().endsWith( "-no-parameter" ) );
    table.addPropertyChangeListener( DrillDownParameterTable.DRILL_DOWN_PARAMETER_PROPERTY, new TableModelBinding() );
  }

  if ( model.isLimitedEditor() ) {
    final XulComponent tooltipAndTargetElement = doc.getElementById( "tooltip-and-target-panel" ); //NON-NLS
    if ( tooltipAndTargetElement != null ) {
      tooltipAndTargetElement.setVisible( false );
    }
  }

  SwingUtilities.invokeLater( new RefreshParameterTask() );
}
 
Example #30
Source File: PreviewController.java    From mql-editor with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void setBindingFactory( BindingFactory bf ) {
  this.bf = bf;
}