org.pentaho.ui.xul.containers.XulDeck Java Examples

The following examples show how to use org.pentaho.ui.xul.containers.XulDeck. 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: FormatStep.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
@Override
public Integer sourceToTarget( final int[] value ) {
  // Handles the case where there is no selection in either groups or details
  if ( ( activeTree.getSelectedIndices() == null || activeTree.getSelectedIndices().length < 1 ) &&
    ( inactiveTree.getSelectedIndices() == null || inactiveTree.getSelectedIndices().length < 1 ) ) {
    return 0;
  }
  // Handles case where nothing is selected in the target
  if ( value == null || value.length < 1 ) { // nothing changes
    final XulDeck deck = (XulDeck) getDocument().getElementById( FORMAT_DECK_ID );
    return deck.getSelectedIndex();
  }
  // Remove the selection from the opposite list
  inactiveTree.setSelectedIndices( new int[ 0 ] );
  // Update the bindings to the new selections
  updateBindings( activeTree );
  // Return index mapping of the current selected item.
  if ( activeTree.getId().equals( FORMAT_DETAILS_LIST_ID ) ) {
    return 1;
  }
  return 2;
}
 
Example #2
Source File: LinearWizardController.java    From pentaho-reporting with GNU Lesser General Public License v2.1 6 votes vote down vote up
public void setActiveStep( final int step ) {
  final int oldActiveStep = this.activeStep;
  if ( oldActiveStep >= 0 ) {
    final WizardStep deactivatingWizardStep = steps.get( oldActiveStep );
    if ( !deactivatingWizardStep.stepDeactivating() ) {
      DebugLog.log( deactivatingWizardStep.getStepName() + ": Canceled setActiveStep()" ); //$NON-NLS-1$
      return;
    }
  }

  this.activeStep = step;
  final WizardStep activatingWizardStep = steps.get( activeStep );
  updateBindings();
  activatingWizardStep.stepActivating();

  // update the controller panel
  final XulDeck deck = (XulDeck) mainXULContainer.getDocumentRoot().getElementById( CONTENT_DECK_ELEMENT_ID );
  deck.setSelectedIndex( activeStep );

  this.firePropertyChange( ACTIVE_STEP_PROPERTY_NAME, oldActiveStep, this.activeStep );
}
 
Example #3
Source File: SpoonPerspectiveManagerTest.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
@Before
public void setUp() throws Exception {
  spoonPerspectiveManager = SpoonPerspectiveManager.getInstance();
  spoonPerspectiveManager = spy( spoonPerspectiveManager );

  perspective = new DummyPerspective();
  spoonPerspectiveManager.addPerspective( perspective );

  // emulate we have one perspective, that is not inited yet.
  perspectiveManagerMap = emulatePerspectiveManagerMap( perspective );

  doReturn( perspectiveManagerMap ).when( spoonPerspectiveManager ).getPerspectiveManagerMap();
  doReturn( mock( Spoon.class ) ).when( spoonPerspectiveManager ).getSpoon();
  spoonPerspectiveManager.setDeck( mock( XulDeck.class ) );
  doReturn( mock( LogChannelInterface.class ) ).when( spoonPerspectiveManager ).getLogger();
}
 
Example #4
Source File: DataHandler.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected void getControls() {

    // Not all of these controls are created at the same time.. that's OK, for now, just check
    // each one for null before using.

    dialogDeck = (XulDeck) document.getElementById( "dialog-panel-deck" );
    deckOptionsBox = (XulListbox) document.getElementById( "deck-options-list" );
    connectionBox = (XulListbox) document.getElementById( "connection-type-list" );
    databaseDialectList = (XulMenuList) document.getElementById( "database-dialect-list" );
    accessBox = (XulListbox) document.getElementById( "access-type-list" );
    connectionNameBox = (XulTextbox) document.getElementById( "connection-name-text" );
    hostNameBox = (XulTextbox) document.getElementById( "server-host-name-text" );
    databaseNameBox = (XulTextbox) document.getElementById( "database-name-text" );
    portNumberBox = (XulTextbox) document.getElementById( "port-number-text" );
    userNameBox = (XulTextbox) document.getElementById( "username-text" );
    passwordBox = (XulTextbox) document.getElementById( "password-text" );
    dataTablespaceBox = (XulTextbox) document.getElementById( "data-tablespace-text" );
    indexTablespaceBox = (XulTextbox) document.getElementById( "index-tablespace-text" );
    serverInstanceBox = (XulTextbox) document.getElementById( "instance-text" );
    serverNameBox = (XulTextbox) document.getElementById( "server-name-text" );
    customUrlBox = (XulTextbox) document.getElementById( "custom-url-text" );
    customDriverClassBox = (XulTextbox) document.getElementById( "custom-driver-class-text" );
    languageBox = (XulTextbox) document.getElementById( "language-text" );
    warehouseBox = (XulTextbox) document.getElementById( "warehouse-text" );
    systemNumberBox = (XulTextbox) document.getElementById( "system-number-text" );
    clientBox = (XulTextbox) document.getElementById( "client-text" );
    doubleDecimalSeparatorCheck = (XulCheckbox) document.getElementById( "decimal-separator-check" );
    resultStreamingCursorCheck = (XulCheckbox) document.getElementById( "result-streaming-check" );
    webAppName = (XulTextbox) document.getElementById( "web-application-name-text" );
    poolingCheck = (XulCheckbox) document.getElementById( "use-pool-check" );
    clusteringCheck = (XulCheckbox) document.getElementById( "use-cluster-check" );
    clusterParameterDescriptionLabel = (XulLabel) document.getElementById( "cluster-parameter-description-label" );
    poolSizeLabel = (XulLabel) document.getElementById( "pool-size-label" );
    poolSizeBox = (XulTextbox) document.getElementById( "pool-size-text" );
    maxPoolSizeLabel = (XulLabel) document.getElementById( "max-pool-size-label" );
    maxPoolSizeBox = (XulTextbox) document.getElementById( "max-pool-size-text" );
    poolParameterTree = (XulTree) document.getElementById( "pool-parameter-tree" );
    clusterParameterTree = (XulTree) document.getElementById( "cluster-parameter-tree" );
    optionsParameterTree = (XulTree) document.getElementById( "options-parameter-tree" );
    poolingDescription = (XulTextbox) document.getElementById( "pooling-description" );
    poolingParameterDescriptionLabel = (XulLabel) document.getElementById( "pool-parameter-description-label" );
    poolingDescriptionLabel = (XulLabel) document.getElementById( "pooling-description-label" );
    supportBooleanDataType = (XulCheckbox) document.getElementById( "supports-boolean-data-type" );
    supportTimestampDataType = (XulCheckbox) document.getElementById( "supports-timestamp-data-type" );
    quoteIdentifiersCheck = (XulCheckbox) document.getElementById( "quote-identifiers-check" );
    lowerCaseIdentifiersCheck = (XulCheckbox) document.getElementById( "force-lower-case-check" );
    upperCaseIdentifiersCheck = (XulCheckbox) document.getElementById( "force-upper-case-check" );
    preserveReservedCaseCheck = (XulCheckbox) document.getElementById( "preserve-reserved-case" );
    strictBigNumberInterpretaion = (XulCheckbox) document.getElementById( "strict-bignum-interpretation" );
    preferredSchemaName = (XulTextbox) document.getElementById( "preferred-schema-name-text" );
    sqlBox = (XulTextbox) document.getElementById( "sql-text" );
    useIntegratedSecurityCheck = (XulCheckbox) document.getElementById( "use-integrated-security-check" );
    acceptButton = (XulButton) document.getElementById( "general-datasource-window_accept" );
    cancelButton = (XulButton) document.getElementById( "general-datasource-window_cancel" );
    testButton = (XulButton) document.getElementById( "test-button" );
    noticeLabel = (XulLabel) document.getElementById( "notice-label" );
    jdbcAuthMethod = (XulMenuList) document.getElementById( "redshift-auth-method-list" );
    iamAccessKeyId = (XulTextbox) document.getElementById( "iam-access-key-id" );
    iamSecretKeyId = (XulTextbox) document.getElementById( "iam-secret-access-key" );
    iamSessionToken = (XulTextbox) document.getElementById( "iam-session-token" );
    iamProfileName = (XulTextbox) document.getElementById( "iam-profile-name" );
    namedClusterList = (XulMenuList) document.getElementById( "named-cluster-list" );

    if ( portNumberBox != null && serverInstanceBox != null ) {
      if ( Boolean.parseBoolean( serverInstanceBox.getAttributeValue( "shouldDisablePortIfPopulated" ) ) ) {
        serverInstanceBox.addPropertyChangeListener( new PropertyChangeListener() {

          @Override
          public void propertyChange( PropertyChangeEvent evt ) {
            if ( "value".equals( evt.getPropertyName() ) ) {
              disablePortIfInstancePopulated();
            }
          }
        } );
      }
    }
  }
 
Example #5
Source File: DataHandlerTest.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
@Before
public void setUp() throws Exception {
  dataHandler = new DataHandler();
  xulDomContainer = mock( XulDomContainer.class );

  document = mock( Document.class );
  XulComponent rootElement = mock( XulComponent.class );
  when( document.getRootElement() ).thenReturn( rootElement );

  // Mock the UI components

  accessBox = mock( XulListbox.class );
  when( document.getElementById( "access-type-list" ) ).thenReturn( accessBox );
  connectionBox = mock( XulListbox.class );
  when( document.getElementById( "connection-type-list" ) ).thenReturn( connectionBox );
  connectionNameBox = mock( XulTextbox.class );
  when( document.getElementById( "connection-name-text" ) ).thenReturn( connectionNameBox );
  dialogDeck = mock( XulDeck.class );
  when( document.getElementById( "dialog-panel-deck" ) ).thenReturn( dialogDeck );
  deckOptionsBox = mock( XulListbox.class );
  when( document.getElementById( "deck-options-list" ) ).thenReturn( deckOptionsBox );
  hostNameBox = mock( XulTextbox.class );
  when( document.getElementById( "server-host-name-text" ) ).thenReturn( hostNameBox );
  databaseNameBox = mock( XulTextbox.class );
  when( document.getElementById( "database-name-text" ) ).thenReturn( databaseNameBox );
  portNumberBox = mock( XulTextbox.class );
  when( document.getElementById( "port-number-text" ) ).thenReturn( portNumberBox );
  userNameBox = mock( XulTextbox.class );
  when( document.getElementById( "username-text" ) ).thenReturn( userNameBox );
  passwordBox = mock( XulTextbox.class );
  when( document.getElementById( "password-text" ) ).thenReturn( passwordBox );
  serverInstanceBox = mock( XulTextbox.class );
  when( document.getElementById( "instance-text" ) ).thenReturn( serverInstanceBox );
  when( serverInstanceBox.getValue() ).thenReturn( "instance" );
  when( serverInstanceBox.getAttributeValue( "shouldDisablePortIfPopulated" ) ).thenReturn( "true" );
  webappName = mock( XulTextbox.class );
  when( document.getElementById( "web-application-name-text" ) ).thenReturn( webappName );
  when( webappName.getValue() ).thenReturn( "webappName" );

  messageBox = mock( XulMessageBox.class );
  when( document.createElement( "messagebox" ) ).thenReturn( messageBox );
  when( xulDomContainer.getDocumentRoot() ).thenReturn( document );

  generalDatasourceWindow = mock( XulRoot.class );
  when( generalDatasourceWindow.getRootObject() ).thenReturn( mock( XulComponent.class ) );
  when( document.getElementById( "general-datasource-window" ) ).thenReturn( generalDatasourceWindow );
  dataHandler.setXulDomContainer( xulDomContainer );
}
 
Example #6
Source File: TrashBrowseController.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private XulTree selectDeletedFileTable( boolean isAdmin ) {
  XulDeck treeDeck = (XulDeck) document.getElementById( "tree-deck" );
  treeDeck.setSelectedIndex( isAdmin ? 1 : 0 );
  return (XulTree) document.getElementById( isAdmin ? "deleted-file-table-admin" : "deleted-file-table" );
}
 
Example #7
Source File: SpoonPerspectiveManager.java    From pentaho-kettle with Apache License 2.0 2 votes vote down vote up
/**
 * Sets the deck used by the Perspective Manager to display Perspectives in.
 *
 * @param deck
 */
public void setDeck( XulDeck deck ) {
  this.deck = deck;
}