formLayout.marginWidth = 0; formLayout.marginHeight = 0; setLayout( formLayout ); setLayoutData( fd ); Composite confUI = createHeadOfNamedClusterDialog( this, namedCluster ); topSeparator.setLayoutData( createFormDataAndAttachTopControl( confUI ) ); compositeSwitcher.setLayoutData( createFormDataAndAttachTopControl( topSeparator ) ); StackLayout compositeLayout = new StackLayout(); compositeSwitcher.setLayout( compositeLayout ); gatewayComposite.setLayout( gatewayCompositeLayout ); gatewayComposite.setSize( gatewayComposite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); createGatewayGroup( gatewayComposite, namedCluster ); noGatewayComposite.setSize( noGatewayComposite.computeSize( SWT.DEFAULT, SWT.DEFAULT ) ); createStorageGroup( noGatewayComposite, namedCluster, namedClusterService ); createHdfsGroup( noGatewayComposite, namedCluster ); createJobTrackerGroup( noGatewayComposite, namedCluster ); createZooKeeperGroup( noGatewayComposite, namedCluster ); createOozieGroup( noGatewayComposite, namedCluster ); createKafkaGroup( noGatewayComposite, namedCluster ); setHdfsAndJobTrackerState( namedCluster );
private void createJobTrackerGroup( Composite parentComposite, final NamedCluster c ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.JobTracker" ) ); Composite jobTrackerRowComposite = createTwoColumnsContainer( pp ); Composite hostUIComposite = new Composite( jobTrackerRowComposite, SWT.NONE ); props.setLook( hostUIComposite ); hostUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); Composite portUIComposite = new Composite( jobTrackerRowComposite, SWT.NONE ); props.setLook( portUIComposite ); portUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); jtHostLabel = createLabel( hostUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Hostname" ), labelGridData ); // hdfs host input Callback hostCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setJobTrackerHost( value ); } }; jtHostNameText = createTextVar( c, hostUIComposite, c.getJobTrackerHost(), gridData, TEXT_FLAGS, hostCB ); jtPortLabel = createLabel( portUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Port" ), portLabelGridData ); // hdfs port input Callback portCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setJobTrackerPort( value ); } }; jtPortText = createTextVar( c, portUIComposite, c.getJobTrackerPort(), numberGridData, TEXT_FLAGS, portCB ); }
private void createKafkaGroup( Composite parentComposite, final NamedCluster namedCluster ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Kafka.GroupTitle" ) ); Composite container = new Composite( pp, SWT.NONE ); props.setLook( container ); GridLayout gridLayout = new GridLayout( ONE_COLUMN, false ); gridLayout.marginBottom = 5; gridLayout.marginTop = 5; container.setLayout( gridLayout ); // kafka label createLabel( container, BaseMessages.getString( PKG, "NamedClusterDialog.Kafka.BootstrapServers.Label" ), labelGridData ); // kafka bootstrap servers Callback bootstrapServersCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setKafkaBootstrapServers( value ); } }; createTextVar( namedCluster, container, namedCluster.getKafkaBootstrapServers(), gridData, TEXT_FLAGS, bootstrapServersCB ); }
props.setLook( scrolledComposite ); NamedClusterComposite namedClusterComposite = new NamedClusterComposite( scrolledComposite, namedCluster, props, namedClusterService ); scrolledComposite.setContent( namedClusterComposite ); namedClusterComposite.pack(); namedClusterComposite.setStateChangeListener( () -> { boolean enabled = !namedCluster.isUseGateway() || ( StringUtils.isNotBlank( namedCluster.getName() )
nameUICluster.setLayout( nameUILayout ); createLabel( nameUICluster, BaseMessages.getString( PKG, "NamedClusterDialog.NamedCluster.Name" ), labelGridData ); if ( shouldRenderGatewayCheckbox( namedCluster ) ) {
createLabel( container, BaseMessages.getString( PKG, "NamedClusterDialog.Storage" ), labelGridData );
private void createOozieGroup( Composite parentComposite, final NamedCluster namedCluster ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Oozie" ) ); Composite container = new Composite( pp, SWT.NONE ); props.setLook( container ); GridLayout gridLayout = new GridLayout( ONE_COLUMN, false ); gridLayout.marginBottom = 5; gridLayout.marginTop = 5; container.setLayout( gridLayout ); // oozie label createLabel( container, BaseMessages.getString( PKG, "NamedClusterDialog.URL" ), labelGridData ); // oozie url Callback hostCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setOozieUrl( value ); } }; createTextVar( namedCluster, container, namedCluster.getOozieUrl(), gridData, TEXT_FLAGS, hostCB ); }
private void createZooKeeperGroup( Composite parentComposite, final NamedCluster c ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.ZooKeeper" ) ); Composite zooKeeperRowComposite = createTwoColumnsContainer( pp ); Composite hostUIComposite = new Composite( zooKeeperRowComposite, SWT.NONE ); props.setLook( hostUIComposite ); hostUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); Composite portUIComposite = new Composite( zooKeeperRowComposite, SWT.NONE ); props.setLook( portUIComposite ); portUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); // hdfs host label createLabel( hostUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Hostname" ), labelGridData ); // hdfs host input Callback hostCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setZooKeeperHost( value ); } }; createTextVar( c, hostUIComposite, c.getZooKeeperHost(), gridData, TEXT_FLAGS, hostCB ); // hdfs port label createLabel( portUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Port" ), portLabelGridData ); // hdfs port input Callback portCB = new Callback() { public void invoke( NamedCluster nc, TextVar textVar, String value ) { nc.setZooKeeperPort( value ); } }; createTextVar( c, portUIComposite, c.getZooKeeperPort(), numberGridData, TEXT_FLAGS, portCB ); }
private void createGatewayGroup( Composite parentComposite, final NamedCluster c ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Gateway" ) ); GridLayout gridLayout = new GridLayout( ONE_COLUMN, false ); gridLayout.marginBottom = 5; gatewayUrlUIComposite.setLayout( gridLayout ); createLabel( gatewayUrlUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.GatewayUrl" ), labelGridData ); createTextVar( c, gatewayUrlUIComposite, c.getGatewayUrl(), gd, TEXT_FLAGS, gatewayUrlCB ); Composite gatewayCredentialsRowComposite = createTwoColumnsContainer( pp ); passwordUIComposite.setLayout( passwordLayout ); createLabel( usernameUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Username" ), userNameLabelGridData ); createTextVar( c, usernameUIComposite, c.getGatewayUsername(), userNameGridData, TEXT_FLAGS, gatewayUsernameCB ); createLabel( passwordUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Password" ), passwordLabelGridData ); createTextVar( c, passwordUIComposite, c.getGatewayPassword(), passwordGridData, PASSWORD_FLAGS, gatewayPasswordCB );
private void createHdfsGroup( Composite parentComposite, final NamedCluster c ) { Composite pp = createGroup( parentComposite, BaseMessages.getString( PKG, "NamedClusterDialog.HDFS" ) ); hdfsGroup = (Group) pp.getParent(); Composite hdfsRowComposite = createTwoColumnsContainer( pp ); Composite hostUIComposite = new Composite( hdfsRowComposite, SWT.NONE ); props.setLook( hostUIComposite ); portUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); hdfsHostLabel = createLabel( hostUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Hostname" ), labelGridData ); hdfsHostText = createTextVar( c, hostUIComposite, c.getHdfsHost(), gridData, TEXT_FLAGS, hdfsHostCB ); hdfsPortLabel = createLabel( portUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Port" ), portLabelGridData ); hdfsPortText = createTextVar( c, portUIComposite, c.getHdfsPort(), numberGridData, TEXT_FLAGS, hdfsPortCB ); Composite hdfsCredentialsRowComposite = createTwoColumnsContainer( pp ); passwordUIComposite.setLayout( new GridLayout( ONE_COLUMN, false ) ); hdfsUsernameLabel = createLabel( usernameUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Username" ), userNameLabelGridData ); hdfsUsernameText = createTextVar( c, usernameUIComposite, c.getHdfsUsername(), userNameGridData, TEXT_FLAGS, hdfsUsernameCB ); hdfsPasswordLabel = createLabel( passwordUIComposite, BaseMessages.getString( PKG, "NamedClusterDialog.Password" ), passwordLabelGridData ); hdfsPasswordText = createTextVar( c, passwordUIComposite, c.getHdfsPassword(), passwordGridData, PASSWORD_FLAGS, hdfsPasswordCB );