Java Code Examples for org.pentaho.di.core.Const#FORM_MARGIN

The following examples show how to use org.pentaho.di.core.Const#FORM_MARGIN . 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: ConfigurationDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
protected void mainLayout( Class<?> PKG, String prefix, Image img ) {
  display = parent.getDisplay();
  shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.APPLICATION_MODAL | SWT.RESIZE | SWT.MAX );
  props.setLook( shell );
  shell.setImage( img );
  shell.setLayout( new FormLayout() );
  shell.setText( BaseMessages.getString( PKG, prefix + ".Shell.Title" ) );

  scContainer = new ScrolledComposite( shell, SWT.NONE | SWT.H_SCROLL | SWT.V_SCROLL );
  scContainer.setLayout( new FormLayout() );
  FormData fd = new FormData();
  fd.top = new FormAttachment( 0, Const.FORM_MARGIN );
  fd.bottom = new FormAttachment( 100, -Const.FORM_MARGIN );
  fd.left = new FormAttachment( 0, Const.FORM_MARGIN );
  fd.right = new FormAttachment( 100, -Const.FORM_MARGIN );
  scContainer.setLayoutData( fd );
  scContainer.setExpandHorizontal( true );
  scContainer.setExpandVertical( true );
  cContainer = new Composite( scContainer, SWT.NONE );
  scContainer.setContent( cContainer );
  cContainer.setLayout( new FormLayout() );
  cContainer.setBackground( shell.getBackground() );
  cContainer.setParent( scContainer );
}
 
Example 2
Source File: CreateDatabaseWizardPageInformix.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public void createControl( Composite parent ) {
  int margin = Const.MARGIN;
  int middle = props.getMiddlePct();

  // create the composite to hold the widgets
  Composite composite = new Composite( parent, SWT.NONE );
  props.setLook( composite );

  FormLayout compLayout = new FormLayout();
  compLayout.marginHeight = Const.FORM_MARGIN;
  compLayout.marginWidth = Const.FORM_MARGIN;
  composite.setLayout( compLayout );

  wlServername = new Label( composite, SWT.RIGHT );
  wlServername.setText( BaseMessages.getString( PKG, "CreateDatabaseWizardPageInformix.Servername.Label" ) );
  props.setLook( wlServername );
  fdlServername = new FormData();
  fdlServername.top = new FormAttachment( 0, 0 );
  fdlServername.left = new FormAttachment( 0, 0 );
  fdlServername.right = new FormAttachment( middle, 0 );
  wlServername.setLayoutData( fdlServername );

  wServername = new Text( composite, SWT.SINGLE | SWT.BORDER );
  props.setLook( wServername );
  fdServername = new FormData();
  fdServername.top = new FormAttachment( 0, 0 );
  fdServername.left = new FormAttachment( middle, margin );
  fdServername.right = new FormAttachment( 100, 0 );
  wServername.setLayoutData( fdServername );
  wServername.addModifyListener( new ModifyListener() {
    public void modifyText( ModifyEvent arg0 ) {
      setPageComplete( false );
    }
  } );

  // set the composite as the control for this page
  setControl( composite );
}
 
Example 3
Source File: Translator.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addGrid() {
  Composite composite = new Composite( sashform, SWT.NONE );
  props.setLook( composite );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;
  composite.setLayout( formLayout );

  wReload = new Button( composite, SWT.NONE );
  wReload.setText( "  &Reload  " );
  wLocale = new Button( composite, SWT.NONE );
  wLocale.setText( "  &Select locale  " );
  wClose = new Button( composite, SWT.NONE );
  wClose.setText( "  &Close " );
  wVerify = new Button( composite, SWT.CHECK );
  wVerify.setText( "&Verify usage" );
  wVerify.setSelection( true ); // Check it!
  wUsed = new Button( composite, SWT.CHECK );
  wUsed.setText( "&Remove used keys" );
  wUsed.setSelection( false ); // Check it!
  wAvailable = new Button( composite, SWT.CHECK );
  wAvailable.setText( "&Check key against other locale" );
  wAvailable.setSelection( true ); // Check it!

  BaseStepDialog.positionBottomButtons( composite, new Button[] {
    wReload, wLocale, wClose, wVerify, wUsed, wAvailable }, Const.MARGIN, null );

  ColumnInfo[] colinf =
    new ColumnInfo[] {
      new ColumnInfo( "Locale", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Package", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Class", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Key", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Value", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Used?", ColumnInfo.COLUMN_TYPE_TEXT, true ),
      new ColumnInfo( "Not available in", ColumnInfo.COLUMN_TYPE_TEXT, true ), };

  wGrid =
    new TableView( Variables.getADefaultVariableSpace(), composite, SWT.BORDER
      | SWT.FULL_SELECTION | SWT.MULTI, colinf, 0, null, PropsUI.getInstance() );

  FormData fdGrid = new FormData();
  fdGrid.left = new FormAttachment( 0, 0 );
  fdGrid.top = new FormAttachment( 0, 0 );
  fdGrid.right = new FormAttachment( 100, 0 );
  fdGrid.bottom = new FormAttachment( wReload, -Const.MARGIN * 3 );
  wGrid.setLayoutData( fdGrid );

}
 
Example 4
Source File: CiviInputDialog.java    From civicrm-data-integration with GNU General Public License v3.0 4 votes vote down vote up
public String open() {
        Shell parent = getParent();
        Display display = parent.getDisplay();

        shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
        props.setLook(shell);
        setShellImage(shell, (StepMetaInterface) input);

        lsMod = new ModifyListener() {
            public void modifyText(ModifyEvent e) {
                ((CiviInputMeta) input).setChanged();
            }
        };
        backupChanged = ((CiviInputMeta) input).hasChanged();

        FormLayout formLayout = new FormLayout();
        formLayout.marginWidth = Const.FORM_MARGIN;
        formLayout.marginHeight = Const.FORM_MARGIN;

        shell.setLayout(formLayout);
        shell.setText(BaseMessages.getString(PKG, "CiviCrmDialog.Shell.Input.Title"));

        middle = props.getMiddlePct();
        margin = Const.MARGIN;

        /*************************************************
         * // STEP NAME ENTRY
         *************************************************/

        wlStepname = new Label(shell, SWT.RIGHT);
        wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
        props.setLook(wlStepname);
        fdlStepname = new FormData();
        fdlStepname.left = new FormAttachment(0, 0);
        fdlStepname.right = new FormAttachment(middle, -margin);
        fdlStepname.top = new FormAttachment(0, margin);
        wlStepname.setLayoutData(fdlStepname);

        wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
        wStepname.setText(stepname);
        props.setLook(wStepname);
        wStepname.addModifyListener(lsMod);
        fdStepname = new FormData();
        fdStepname.left = new FormAttachment(middle, 0);
        fdStepname.top = new FormAttachment(0, margin);
        fdStepname.right = new FormAttachment(100, 0);
        wStepname.setLayoutData(fdStepname);

        addOKCancelButtons();
        addConnectionTab();
        addEntityGroup();
        addOutputTab();

//        wCiviCrmRestUrl.setText("${REST_URL}");
//        wCiviCrmSiteKey.setText("${SITE_KEY}");
//        wCiviCrmApiKey.setText("${API_KEY}");

        /*************************************************
         * // DEFAULT ACTION LISTENERS
         *************************************************/


        lsDef = new SelectionAdapter() {
            public void widgetDefaultSelected(SelectionEvent e) {
                ok();
            }
        };

        wStepname.addSelectionListener(lsDef);
        wCiviCrmRestUrl.addSelectionListener(lsDef);
        wCiviCrmRestUrl.addSelectionListener(lsDef);
        wCiviCrmSiteKey.addSelectionListener(lsDef);
        wCiviCrmEntity.addSelectionListener(lsDef);

        // Detect X or ALT-F4 or something that kills this window...
        shell.addShellListener(new ShellAdapter() {
            public void shellClosed(ShellEvent e) {
                cancel();
            }
        });

        // Set the shell size, based upon previous time...
        setSize();

        /*************************************************
         * // POPULATE AND OPEN DIALOG
         *************************************************/

        getData();
        // setComboValues();

        ((CiviInputMeta) input).setChanged(backupChanged);

        shell.open();
        while (!shell.isDisposed()) {
            if (!display.readAndDispatch())
                display.sleep();
        }
        return stepname;
    }
 
Example 5
Source File: TextFileInputDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addFiltersTabs() {
  // Filters tab...
  //
  wFilterTab = new CTabItem( wTabFolder, SWT.NONE );
  wFilterTab.setText( BaseMessages.getString( PKG, "TextFileInputDialog.FilterTab.TabTitle" ) );

  FormLayout FilterLayout = new FormLayout();
  FilterLayout.marginWidth = Const.FORM_MARGIN;
  FilterLayout.marginHeight = Const.FORM_MARGIN;

  wFilterComp = new Composite( wTabFolder, SWT.NONE );
  wFilterComp.setLayout( FilterLayout );
  props.setLook( wFilterComp );

  final int FilterRows = input.getFilter().length;

  ColumnInfo[] colinf =
      new ColumnInfo[] {
        new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterStringColumn.Column" ),
            ColumnInfo.COLUMN_TYPE_TEXT, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositionColumn.Column" ),
            ColumnInfo.COLUMN_TYPE_TEXT, false ),
        new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.StopOnFilterColumn.Column" ),
            ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ),
        new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Column" ),
            ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ) };

  colinf[2].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.StopOnFilterColumn.Tooltip" ) );
  colinf[3].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Tooltip" ) );

  wFilter = new TableView( transMeta, wFilterComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FilterRows, lsMod, props );

  fdFilter = new FormData();
  fdFilter.left = new FormAttachment( 0, 0 );
  fdFilter.top = new FormAttachment( 0, 0 );
  fdFilter.right = new FormAttachment( 100, 0 );
  fdFilter.bottom = new FormAttachment( 100, 0 );
  wFilter.setLayoutData( fdFilter );

  fdFilterComp = new FormData();
  fdFilterComp.left = new FormAttachment( 0, 0 );
  fdFilterComp.top = new FormAttachment( 0, 0 );
  fdFilterComp.right = new FormAttachment( 100, 0 );
  fdFilterComp.bottom = new FormAttachment( 100, 0 );
  wFilterComp.setLayoutData( fdFilterComp );

  wFilterComp.layout();
  wFilterTab.setControl( wFilterComp );
}
 
Example 6
Source File: SlaveServerDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addProxyTab() {
  // ////////////////////////
  // START OF POOL TAB///
  // /
  wProxyTab = new CTabItem( wTabFolder, SWT.NONE );
  wProxyTab.setText( BaseMessages.getString( PKG, "SlaveServerDialog.USER_TAB_PROXY" ) );

  FormLayout poolLayout = new FormLayout();
  poolLayout.marginWidth = Const.FORM_MARGIN;
  poolLayout.marginHeight = Const.FORM_MARGIN;

  wProxyComp = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wProxyComp );
  wProxyComp.setLayout( poolLayout );

  // What's the data tablespace name?
  Label wlProxyHost = new Label( wProxyComp, SWT.RIGHT );
  props.setLook( wlProxyHost );
  wlProxyHost.setText( BaseMessages.getString( PKG, "SlaveServerDialog.ProxyServerName.Label" ) );
  FormData fdlProxyHost = new FormData();
  fdlProxyHost.top = new FormAttachment( 0, 0 );
  fdlProxyHost.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdlProxyHost.right = new FormAttachment( middle, -margin );
  wlProxyHost.setLayoutData( fdlProxyHost );

  wProxyHost = new TextVar( slaveServer, wProxyComp, SWT.BORDER | SWT.LEFT | SWT.SINGLE );
  props.setLook( wProxyHost );
  wProxyHost.addModifyListener( lsMod );
  FormData fdProxyHost = new FormData();
  fdProxyHost.top = new FormAttachment( 0, 0 );
  fdProxyHost.left = new FormAttachment( middle, 0 ); // To the right of the label
  fdProxyHost.right = new FormAttachment( 95, 0 );
  wProxyHost.setLayoutData( fdProxyHost );

  // What's the initial pool size
  Label wlProxyPort = new Label( wProxyComp, SWT.RIGHT );
  props.setLook( wlProxyPort );
  wlProxyPort.setText( BaseMessages.getString( PKG, "SlaveServerDialog.ProxyServerPort.Label" ) );
  FormData fdlProxyPort = new FormData();
  fdlProxyPort.top = new FormAttachment( wProxyHost, margin );
  fdlProxyPort.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdlProxyPort.right = new FormAttachment( middle, -margin );
  wlProxyPort.setLayoutData( fdlProxyPort );

  wProxyPort = new TextVar( slaveServer, wProxyComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wProxyPort );
  wProxyPort.addModifyListener( lsMod );
  FormData fdProxyPort = new FormData();
  fdProxyPort.top = new FormAttachment( wProxyHost, margin );
  fdProxyPort.left = new FormAttachment( middle, 0 ); // To the right of the label
  fdProxyPort.right = new FormAttachment( 95, 0 );
  wProxyPort.setLayoutData( fdProxyPort );

  // What's the maximum pool size
  Label wlNonProxyHosts = new Label( wProxyComp, SWT.RIGHT );
  props.setLook( wlNonProxyHosts );
  wlNonProxyHosts.setText( BaseMessages.getString( PKG, "SlaveServerDialog.IgnoreProxyForHosts.Label" ) );
  FormData fdlNonProxyHosts = new FormData();
  fdlNonProxyHosts.top = new FormAttachment( wProxyPort, margin );
  fdlNonProxyHosts.left = new FormAttachment( 0, 0 ); // First one in the left top corner
  fdlNonProxyHosts.right = new FormAttachment( middle, -margin );
  wlNonProxyHosts.setLayoutData( fdlNonProxyHosts );

  wNonProxyHosts = new TextVar( slaveServer, wProxyComp, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wNonProxyHosts );
  wNonProxyHosts.addModifyListener( lsMod );
  FormData fdNonProxyHosts = new FormData();
  fdNonProxyHosts.top = new FormAttachment( wProxyPort, margin );
  fdNonProxyHosts.left = new FormAttachment( middle, 0 ); // To the right of the label
  fdNonProxyHosts.right = new FormAttachment( 95, 0 );
  wNonProxyHosts.setLayoutData( fdNonProxyHosts );

  fdProxyComp = new FormData();
  fdProxyComp.left = new FormAttachment( 0, 0 );
  fdProxyComp.top = new FormAttachment( 0, 0 );
  fdProxyComp.right = new FormAttachment( 100, 0 );
  fdProxyComp.bottom = new FormAttachment( 100, 0 );
  wProxyComp.setLayoutData( fdProxyComp );

  wProxyComp.layout();
  wProxyTab.setControl( wProxyComp );
}
 
Example 7
Source File: PropertiesDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public Map<String, String> open() {
  PropsUI props = PropsUI.getInstance();
  Shell parent = getParent();
  Display display = parent.getDisplay();

  shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE );
  props.setLook( shell );
  shell.setImage( GUIResource.getInstance().getImageSpoon() );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;

  shell.setLayout( formLayout );
  shell.setText( getText() );

  if ( StringUtils.isNotEmpty( helpUrl ) ) {
    HelpUtils.createHelpButton( shell, helpTitle, helpUrl, helpHeader );
  }

  Button wCancel = new Button( shell, SWT.PUSH );
  wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) );
  FormData fdCancel = new FormData();
  fdCancel.right = new FormAttachment( 100, 0 );
  fdCancel.bottom = new FormAttachment( 100, 0 );
  wCancel.setLayoutData( fdCancel );
  wCancel.addListener( SWT.Selection, e -> close() );

  Button wOK = new Button( shell, SWT.PUSH );
  wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  FormData fdOk = new FormData();
  fdOk.right = new FormAttachment( wCancel, -5 );
  fdOk.bottom = new FormAttachment( 100, 0 );
  wOK.setLayoutData( fdOk );
  wOK.addListener( SWT.Selection, e -> ok() );

  ColumnInfo[] columns = createColumns();

  propertiesTable = new TableView(
    transMeta,
    shell,
    SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI,
    columns,
    10,
    false,
    null,
    props,
    false
  );

  propertiesTable.setSortable( false );
  propertiesTable.getTable().addListener( SWT.Resize, event -> {
    Table table = (Table) event.widget;
    table.getColumn( 1 ).setWidth( 220 );
    table.getColumn( 2 ).setWidth( 220 );
  } );

  populateData();

  FormData fdData = new FormData();
  fdData.left = new FormAttachment( 0, 0 );
  fdData.top = new FormAttachment( 0, 0 );
  fdData.right = new FormAttachment( 100, 0 );
  fdData.bottom = new FormAttachment( wOK, 0 );
  fdData.width = 450;

  propertiesTable.setLayoutData( fdData );

  BaseStepDialog.setSize( shell );

  shell.open();
  while ( !shell.isDisposed() ) {
    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }

  return properties;
}
 
Example 8
Source File: TextFileInputDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addFiltersTabs() {
  // Filters tab...
  //
  wFilterTab = new CTabItem( wTabFolder, SWT.NONE );
  wFilterTab.setText( BaseMessages.getString( PKG, "TextFileInputDialog.FilterTab.TabTitle" ) );

  FormLayout FilterLayout = new FormLayout();
  FilterLayout.marginWidth = Const.FORM_MARGIN;
  FilterLayout.marginHeight = Const.FORM_MARGIN;

  wFilterComp = new Composite( wTabFolder, SWT.NONE );
  wFilterComp.setLayout( FilterLayout );
  props.setLook( wFilterComp );

  final int FilterRows = input.getFilter().length;

  ColumnInfo[] colinf =
      new ColumnInfo[] { new ColumnInfo( BaseMessages.getString( PKG,
          "TextFileInputDialog.FilterStringColumn.Column" ), ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo(
              BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositionColumn.Column" ),
              ColumnInfo.COLUMN_TYPE_TEXT, false ), new ColumnInfo( BaseMessages.getString( PKG,
                  "TextFileInputDialog.StopOnFilterColumn.Column" ), ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ),
        new ColumnInfo( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Column" ),
            ColumnInfo.COLUMN_TYPE_CCOMBO, YES_NO_COMBO ) };

  colinf[2].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.StopOnFilterColumn.Tooltip" ) );
  colinf[3].setToolTip( BaseMessages.getString( PKG, "TextFileInputDialog.FilterPositiveColumn.Tooltip" ) );

  wFilter = new TableView( transMeta, wFilterComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FilterRows, lsMod, props );

  fdFilter = new FormData();
  fdFilter.left = new FormAttachment( 0, 0 );
  fdFilter.top = new FormAttachment( 0, 0 );
  fdFilter.right = new FormAttachment( 100, 0 );
  fdFilter.bottom = new FormAttachment( 100, 0 );
  wFilter.setLayoutData( fdFilter );

  fdFilterComp = new FormData();
  fdFilterComp.left = new FormAttachment( 0, 0 );
  fdFilterComp.top = new FormAttachment( 0, 0 );
  fdFilterComp.right = new FormAttachment( 100, 0 );
  fdFilterComp.bottom = new FormAttachment( 100, 0 );
  wFilterComp.setLayoutData( fdFilterComp );

  wFilterComp.layout();
  wFilterTab.setControl( wFilterComp );
}
 
Example 9
Source File: ElasticSearchBulkDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addServersTab() {
  wServersTab = new CTabItem( wTabFolder, SWT.NONE );
  wServersTab.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.ServersTab.TabTitle" ) );

  FormLayout serversLayout = new FormLayout();
  serversLayout.marginWidth = Const.FORM_MARGIN;
  serversLayout.marginHeight = Const.FORM_MARGIN;

  Composite wServersComp = new Composite( wTabFolder, SWT.NONE );
  wServersComp.setLayout( serversLayout );
  props.setLook( wServersComp );

  // Test button
  wTestCl = new Button( wServersComp, SWT.PUSH );
  wTestCl.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.TestCluster.Label" ) );
  wTestCl.setToolTipText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.TestCluster.Tooltip" ) );

  wTestCl.addListener( SWT.Selection, new Listener() {

    public void handleEvent( Event arg0 ) {
      test( TestType.CLUSTER );
    }
  } );

  setButtonPositions( new Button[]{wTestCl}, Const.MARGIN, null );

  ColumnInfo[] columnsMeta = new ColumnInfo[2];
  columnsMeta[0] =
          new ColumnInfo( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.ServersTab.Address.Column" ),
                  ColumnInfo.COLUMN_TYPE_TEXT, false );
  columnsMeta[0].setUsingVariables( true );
  columnsMeta[1] =
          new ColumnInfo( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.ServersTab.Port.Column" ),
                  ColumnInfo.COLUMN_TYPE_TEXT, true );

  wServers =
          new TableView( transMeta, wServersComp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, columnsMeta, 1, lsMod,
                  props );
  FormData fdServers = new FormData();
  fdServers.left = new FormAttachment( 0, Const.MARGIN );
  fdServers.top = new FormAttachment( 0, Const.MARGIN );
  fdServers.right = new FormAttachment( 100, -Const.MARGIN );
  fdServers.bottom = new FormAttachment( wTestCl, -Const.MARGIN );
  wServers.setLayoutData( fdServers );

  FormData fdServersComp = new FormData();
  fdServersComp.left = new FormAttachment( 0, 0 );
  fdServersComp.top = new FormAttachment( 0, 0 );
  fdServersComp.right = new FormAttachment( 100, 0 );
  fdServersComp.bottom = new FormAttachment( 100, 0 );
  wServersComp.setLayoutData( fdServersComp );
  wServersComp.layout();
  wServersTab.setControl( wServersComp );
}
 
Example 10
Source File: JsonInputDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addFieldsTab() {
  // Fields tab...
  CTabItem wFieldsTab = new CTabItem( wTabFolder, SWT.NONE );
  wFieldsTab.setText( BaseMessages.getString( PKG, "JsonInputDialog.Fields.Tab" ) );

  FormLayout fieldsLayout = new FormLayout();
  fieldsLayout.marginWidth = Const.FORM_MARGIN;
  fieldsLayout.marginHeight = Const.FORM_MARGIN;

  Composite wFieldsComp = new Composite( wTabFolder, SWT.NONE );
  wFieldsComp.setLayout( fieldsLayout );
  props.setLook( wFieldsComp );

  wGet = new Button( wFieldsComp, SWT.PUSH );
  wGet.setText( BaseMessages.getString( PKG, "JsonInputDialog.Button.SelectFields" ) );
  fdGet = new FormData();
  fdGet.left = new FormAttachment( 50, 0 );
  fdGet.bottom = new FormAttachment( 100, 0 );
  wGet.setLayoutData( fdGet );

  setButtonPositions( new Button[] { wGet }, margin, null );

  final int FieldsRows = input.getInputFields().length;

  ColumnInfo[] colinf =
    new ColumnInfo[] {
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Name.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Path.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Type.Column" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames(), true ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Format.Column" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, Const.getConversionFormats() ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Length.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Precision.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Currency.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Decimal.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Group.Column" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.TrimType.Column" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaBase.trimTypeDesc, true ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Repeat.Column" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, new String[] {YES, NO }, true ),
    };

  colinf[0].setUsingVariables( true );
  colinf[0].setToolTip( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Name.Column.Tooltip" ) );
  colinf[1].setUsingVariables( true );
  colinf[1].setToolTip( BaseMessages.getString( PKG, "JsonInputDialog.FieldsTable.Path.Column.Tooltip" ) );

  wFields =
    new TableView( transMeta, wFieldsComp, SWT.FULL_SELECTION | SWT.MULTI, colinf, FieldsRows, lsMod, props );

  FormData fdFields = new FormData();
  fdFields.left = new FormAttachment( 0, 0 );
  fdFields.top = new FormAttachment( 0, 0 );
  fdFields.right = new FormAttachment( 100, 0 );
  fdFields.bottom = new FormAttachment( wGet, -margin );
  wFields.setLayoutData( fdFields );

  FormData fdFieldsComp = new FormData();
  fdFieldsComp.left = new FormAttachment( 0, 0 );
  fdFieldsComp.top = new FormAttachment( 0, 0 );
  fdFieldsComp.right = new FormAttachment( 100, 0 );
  fdFieldsComp.bottom = new FormAttachment( 100, 0 );
  wFieldsComp.setLayoutData( fdFieldsComp );

  wFieldsComp.layout();
  wFieldsTab.setControl( wFieldsComp );
}
 
Example 11
Source File: IngresVectorwiseLoaderDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see org.pentaho.di.trans.step.StepDialogInterface#open()
 */
public String open() {
  shell = new Shell( getParent(), SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX );
  props.setLook( shell );

  setShellImage( shell, input );

  changed = input.hasChanged();

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;

  shell.setLayout( formLayout );
  shell.setText( BaseMessages.getString( PKG, "IngresVectorwiseLoaderDialog.Shell.Title" ));

  middle = props.getMiddlePct();
  margin = Const.MARGIN;

  /************************************** Step name line ***************************/
  // label
  wlStepname = new Label( shell, SWT.RIGHT );
  wlStepname.setText( "Step Name" );
  wlStepname.setLayoutData( standardLabelSpacing( null, null ) );
  props.setLook( wlStepname );

  // text entry
  wStepname = new Text( shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wStepname.setText( stepname );
  wStepname.addModifyListener( lsMod );
  wStepname.setLayoutData( standardInputSpacing( null, wlStepname ) );
  props.setLook( wStepname );

  Control lastControl = addDbConnectionInputs();
  lastControl = addCustomInputs( lastControl );

  addVerticalPadding( 2 * margin );

  /********************************** OK and Cancel buttons **************************/
  addDefaultButtons( margin, lastControl );

  lastControl = addFieldSelection( lastControl );

  getData();
  input.setChanged( changed );

  // Add listeners
  // Listener lsVisualize = new Listener() { public void handleEvent(Event e) { quickVisualize(); } };

  // wVisualize.addListener(SWT.Selection, lsVisualize );

  shell.open();
  while ( !shell.isDisposed() ) {
    Display display = getParent().getDisplay();

    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  return stepname;
}
 
Example 12
Source File: UserDefinedJavaClassDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addParametersTab() {
  parametersTab = new CTabItem( wTabFolder, SWT.NONE );
  parametersTab.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Tabs.Parameters.Title" ) );
  parametersTab.setToolTipText( BaseMessages.getString(
    PKG, "UserDefinedJavaClassDialog.Tabs.Parameters.TooltipText" ) );

  Composite wBottom = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wBottom );
  parametersTab.setControl( wBottom );
  FormLayout bottomLayout = new FormLayout();
  bottomLayout.marginWidth = Const.FORM_MARGIN;
  bottomLayout.marginHeight = Const.FORM_MARGIN;
  wBottom.setLayout( bottomLayout );

  Label wlFields = new Label( wBottom, SWT.NONE );
  wlFields.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Parameters.Label" ) );
  props.setLook( wlFields );
  FormData fdlFields = new FormData();
  fdlFields.left = new FormAttachment( 0, 0 );
  fdlFields.top = new FormAttachment( 0, 0 );
  wlFields.setLayoutData( fdlFields );

  final int nrRows = input.getUsageParameters().size();
  ColumnInfo[] colinf =
    new ColumnInfo[] {
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.ParameterTag" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.ParameterValue" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.ParameterDescription" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ), };
  colinf[1].setUsingVariables( true );

  wParameters =
    new TableView(
      transMeta, wBottom, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, nrRows, lsMod, props );

  FormData fdFields = new FormData();
  fdFields.left = new FormAttachment( 0, 0 );
  fdFields.top = new FormAttachment( wlFields, margin );
  fdFields.right = new FormAttachment( 100, 0 );
  fdFields.bottom = new FormAttachment( 100, 0 );
  wParameters.setLayoutData( fdFields );

  FormData fdBottom = new FormData();
  fdBottom.left = new FormAttachment( 0, 0 );
  fdBottom.top = new FormAttachment( 0, 0 );
  fdBottom.right = new FormAttachment( 100, 0 );
  fdBottom.bottom = new FormAttachment( 100, 0 );
  wBottom.setLayoutData( fdBottom );
}
 
Example 13
Source File: UserDefinedJavaClassDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addInfoTab() {
  infoTab = new CTabItem( wTabFolder, SWT.NONE );
  infoTab.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Tabs.Info.Title" ) );
  infoTab.setToolTipText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Tabs.Info.TooltipText" ) );

  Composite wBottom = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wBottom );
  infoTab.setControl( wBottom );
  FormLayout bottomLayout = new FormLayout();
  bottomLayout.marginWidth = Const.FORM_MARGIN;
  bottomLayout.marginHeight = Const.FORM_MARGIN;
  wBottom.setLayout( bottomLayout );

  Label wlFields = new Label( wBottom, SWT.NONE );
  wlFields.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.InfoSteps.Label" ) );
  props.setLook( wlFields );
  FormData fdlFields = new FormData();
  fdlFields.left = new FormAttachment( 0, 0 );
  fdlFields.top = new FormAttachment( 0, 0 );
  wlFields.setLayoutData( fdlFields );

  final int nrRows = input.getInfoStepDefinitions().size();
  ColumnInfo[] colinf =
    new ColumnInfo[] {
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.StepTag" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.StepName" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, prevStepNames ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.StepDescription" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ), };

  wInfoSteps =
    new TableView(
      transMeta, wBottom, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, nrRows, lsMod, props );

  FormData fdFields = new FormData();
  fdFields.left = new FormAttachment( 0, 0 );
  fdFields.top = new FormAttachment( wlFields, margin );
  fdFields.right = new FormAttachment( 100, 0 );
  fdFields.bottom = new FormAttachment( 100, 0 );
  wInfoSteps.setLayoutData( fdFields );

  FormData fdBottom = new FormData();
  fdBottom.left = new FormAttachment( 0, 0 );
  fdBottom.top = new FormAttachment( 0, 0 );
  fdBottom.right = new FormAttachment( 100, 0 );
  fdBottom.bottom = new FormAttachment( 100, 0 );
  wBottom.setLayoutData( fdBottom );
}
 
Example 14
Source File: UserDefinedJavaClassDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addFieldsTab() {
  fieldsTab = new CTabItem( wTabFolder, SWT.NONE );
  fieldsTab.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Tabs.Fields.Title" ) );
  fieldsTab.setToolTipText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Tabs.Fields.TooltipText" ) );

  Composite wBottom = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wBottom );
  fieldsTab.setControl( wBottom );
  FormLayout bottomLayout = new FormLayout();
  bottomLayout.marginWidth = Const.FORM_MARGIN;
  bottomLayout.marginHeight = Const.FORM_MARGIN;
  wBottom.setLayout( bottomLayout );

  Label wlFields = new Label( wBottom, SWT.NONE );
  wlFields.setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.Fields.Label" ) );
  props.setLook( wlFields );
  FormData fdlFields = new FormData();
  fdlFields.left = new FormAttachment( 0, 0 );
  fdlFields.top = new FormAttachment( 0, 0 );
  wlFields.setLayoutData( fdlFields );

  wClearResultFields = new Button( wBottom, SWT.CHECK );
  wClearResultFields
    .setText( BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ClearResultFields.Label" ) );
  props.setLook( wClearResultFields );
  FormData fdClearResultFields = new FormData();
  fdClearResultFields.right = new FormAttachment( 100, 0 );
  fdClearResultFields.top = new FormAttachment( 0, 0 );
  wClearResultFields.setLayoutData( fdClearResultFields );

  final int fieldsRows = input.getFieldInfo().size();

  ColumnInfo[] colinf =
    new ColumnInfo[] {
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.Filename" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.Type" ),
        ColumnInfo.COLUMN_TYPE_CCOMBO, ValueMetaFactory.getValueMetaNames() ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.Length" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ),
      new ColumnInfo(
        BaseMessages.getString( PKG, "UserDefinedJavaClassDialog.ColumnInfo.Precision" ),
        ColumnInfo.COLUMN_TYPE_TEXT, false ), };

  wFields =
    new TableView(
      transMeta, wBottom, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI, colinf, fieldsRows, lsMod, props );

  FormData fdFields = new FormData();
  fdFields.left = new FormAttachment( 0, 0 );
  fdFields.top = new FormAttachment( wlFields, margin );
  fdFields.right = new FormAttachment( 100, 0 );
  fdFields.bottom = new FormAttachment( 100, 0 );
  wFields.setLayoutData( fdFields );

  FormData fdBottom = new FormData();
  fdBottom.left = new FormAttachment( 0, 0 );
  fdBottom.top = new FormAttachment( 0, 0 );
  fdBottom.right = new FormAttachment( 100, 0 );
  fdBottom.bottom = new FormAttachment( 100, 0 );
  wBottom.setLayoutData( fdBottom );

}
 
Example 15
Source File: TeraFastDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 *
 * @see org.pentaho.di.trans.step.StepDialogInterface#open()
 */
public String open() {
  this.changed = this.meta.hasChanged();

  final Shell parent = getParent();
  final Display display = parent.getDisplay();

  this.shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX );
  this.props.setLook( this.shell );
  setShellImage( this.shell, this.meta );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;

  this.shell.setLayout( formLayout );
  this.shell.setText( BaseMessages.getString( PKG, "TeraFastDialog.Shell.Title" ) );

  buildUi();
  assignChangeListener();
  listeners();

  //
  // Search the fields in the background
  //

  final Runnable runnable = new Runnable() {
    public void run() {
      final StepMeta stepMetaSearchFields =
        TeraFastDialog.this.transMeta.findStep( TeraFastDialog.this.stepname );
      if ( stepMetaSearchFields == null ) {
        return;
      }
      try {
        final RowMetaInterface row = TeraFastDialog.this.transMeta.getPrevStepFields( stepMetaSearchFields );

        // Remember these fields...
        for ( int i = 0; i < row.size(); i++ ) {
          TeraFastDialog.this.inputFields.put( row.getValueMeta( i ).getName(), Integer.valueOf( i ) );
        }

        setComboBoxes();
      } catch ( KettleException e ) {
        TeraFastDialog.this.logError( BaseMessages.getString( PKG, "System.Dialog.GetFieldsFailed.Message" ) );
      }
    }
  };
  new Thread( runnable ).start();
  //
  // // Set the shell size, based upon previous time...
  setSize();

  getData();
  this.meta.setChanged( this.changed );
  disableInputs();

  this.shell.open();
  while ( !this.shell.isDisposed() ) {
    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  return this.stepname;
}
 
Example 16
Source File: TransDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addMonitoringTab() {
  // ////////////////////////
  // START OF MONITORING TAB///
  // /
  wMonitorTab = new CTabItem( wTabFolder, SWT.NONE );
  wMonitorTab.setText( BaseMessages.getString( PKG, "TransDialog.MonitorTab.Label" ) );

  Composite wMonitorComp = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wMonitorComp );

  FormLayout monitorLayout = new FormLayout();
  monitorLayout.marginWidth = Const.FORM_MARGIN;
  monitorLayout.marginHeight = Const.FORM_MARGIN;
  wMonitorComp.setLayout( monitorLayout );

  //
  // Enable step performance monitoring?
  //
  Label wlEnableStepPerfMonitor = new Label( wMonitorComp, SWT.LEFT );
  wlEnableStepPerfMonitor.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMonitoring.Label" ) );
  props.setLook( wlEnableStepPerfMonitor );
  FormData fdlSchemaName = new FormData();
  fdlSchemaName.left = new FormAttachment( 0, 0 );
  fdlSchemaName.right = new FormAttachment( middle, -margin );
  fdlSchemaName.top = new FormAttachment( 0, 0 );
  wlEnableStepPerfMonitor.setLayoutData( fdlSchemaName );
  wEnableStepPerfMonitor = new Button( wMonitorComp, SWT.CHECK );
  props.setLook( wEnableStepPerfMonitor );
  FormData fdEnableStepPerfMonitor = new FormData();
  fdEnableStepPerfMonitor.left = new FormAttachment( middle, 0 );
  fdEnableStepPerfMonitor.right = new FormAttachment( 100, 0 );
  fdEnableStepPerfMonitor.top = new FormAttachment( 0, 0 );
  wEnableStepPerfMonitor.setLayoutData( fdEnableStepPerfMonitor );
  wEnableStepPerfMonitor.addSelectionListener( lsModSel );
  wEnableStepPerfMonitor.addSelectionListener( new SelectionAdapter() {
    public void widgetSelected( SelectionEvent selectionEvent ) {
      setFlags();
    }
  } );

  //
  // Step performance interval
  //
  Label wlStepPerfInterval = new Label( wMonitorComp, SWT.LEFT );
  wlStepPerfInterval.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceInterval.Label" ) );
  props.setLook( wlStepPerfInterval );
  FormData fdlStepPerfInterval = new FormData();
  fdlStepPerfInterval.left = new FormAttachment( 0, 0 );
  fdlStepPerfInterval.right = new FormAttachment( middle, -margin );
  fdlStepPerfInterval.top = new FormAttachment( wEnableStepPerfMonitor, margin );
  wlStepPerfInterval.setLayoutData( fdlStepPerfInterval );
  wStepPerfInterval = new Text( wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  props.setLook( wStepPerfInterval );
  FormData fdStepPerfInterval = new FormData();
  fdStepPerfInterval.left = new FormAttachment( middle, 0 );
  fdStepPerfInterval.right = new FormAttachment( 100, 0 );
  fdStepPerfInterval.top = new FormAttachment( wEnableStepPerfMonitor, margin );
  wStepPerfInterval.setLayoutData( fdStepPerfInterval );
  wStepPerfInterval.addModifyListener( lsMod );

  //
  // Step performance interval
  //
  Label wlStepPerfMaxSize = new Label( wMonitorComp, SWT.LEFT );
  wlStepPerfMaxSize.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Label" ) );
  wlStepPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Tooltip" ) );
  props.setLook( wlStepPerfMaxSize );
  FormData fdlStepPerfMaxSize = new FormData();
  fdlStepPerfMaxSize.left = new FormAttachment( 0, 0 );
  fdlStepPerfMaxSize.right = new FormAttachment( middle, -margin );
  fdlStepPerfMaxSize.top = new FormAttachment( wStepPerfInterval, margin );
  wlStepPerfMaxSize.setLayoutData( fdlStepPerfMaxSize );
  wStepPerfMaxSize = new TextVar( transMeta, wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  wStepPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Tooltip" ) );
  props.setLook( wStepPerfMaxSize );
  FormData fdStepPerfMaxSize = new FormData();
  fdStepPerfMaxSize.left = new FormAttachment( middle, 0 );
  fdStepPerfMaxSize.right = new FormAttachment( 100, 0 );
  fdStepPerfMaxSize.top = new FormAttachment( wStepPerfInterval, margin );
  wStepPerfMaxSize.setLayoutData( fdStepPerfMaxSize );
  wStepPerfMaxSize.addModifyListener( lsMod );

  FormData fdMonitorComp = new FormData();
  fdMonitorComp.left = new FormAttachment( 0, 0 );
  fdMonitorComp.top = new FormAttachment( 0, 0 );
  fdMonitorComp.right = new FormAttachment( 100, 0 );
  fdMonitorComp.bottom = new FormAttachment( 100, 0 );
  wMonitorComp.setLayoutData( fdMonitorComp );

  wMonitorComp.layout();
  wMonitorTab.setControl( wMonitorComp );

  // ///////////////////////////////////////////////////////////
  // / END OF MONITORING TAB
  // ///////////////////////////////////////////////////////////

}
 
Example 17
Source File: TransformationHasTransLogConfiguredImportRuleComposite.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) {
  PropsUI props = PropsUI.getInstance();

  composite = new Composite( parent, SWT.NONE );
  props.setLook( composite );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;
  composite.setLayout( formLayout );

  // Schema input field...
  //
  Label schemaLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( schemaLabel );
  schemaLabel.setText( "Schema " );
  FormData fdSchemaLabel = new FormData();
  fdSchemaLabel.left = new FormAttachment( 0, 0 );
  fdSchemaLabel.top = new FormAttachment( 0, 0 );
  schemaLabel.setLayoutData( fdSchemaLabel );

  schemaText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( schemaText );
  FormData fdSchemaText = new FormData();
  fdSchemaText.left = new FormAttachment( schemaLabel, Const.MARGIN );
  fdSchemaText.top = new FormAttachment( 0, 0 );
  fdSchemaText.right = new FormAttachment( schemaLabel, 150 );
  schemaText.setLayoutData( fdSchemaText );

  // Table name input field...
  //
  Label tableLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( tableLabel );
  tableLabel.setText( "Table " );
  FormData fdTableLabel = new FormData();
  fdTableLabel.left = new FormAttachment( schemaText, Const.MARGIN );
  fdTableLabel.top = new FormAttachment( 0, 0 );
  tableLabel.setLayoutData( fdTableLabel );

  tableText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( tableText );
  FormData fdTableText = new FormData();
  fdTableText.left = new FormAttachment( tableLabel, Const.MARGIN );
  fdTableText.top = new FormAttachment( 0, 0 );
  fdTableText.right = new FormAttachment( tableLabel, 150 );
  tableText.setLayoutData( fdTableText );

  // Connection name input field...
  //
  Label connectionLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( connectionLabel );
  connectionLabel.setText( "Connection " );
  FormData fdConnectionLabel = new FormData();
  fdConnectionLabel.left = new FormAttachment( tableText, Const.MARGIN );
  fdConnectionLabel.top = new FormAttachment( 0, 0 );
  connectionLabel.setLayoutData( fdConnectionLabel );

  connectionText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( connectionText );
  FormData fdConnectionText = new FormData();
  fdConnectionText.left = new FormAttachment( connectionLabel, Const.MARGIN );
  fdConnectionText.top = new FormAttachment( 0, 0 );
  fdConnectionText.right = new FormAttachment( connectionLabel, 200 );
  connectionText.setLayoutData( fdConnectionText );

  return composite;
}
 
Example 18
Source File: JobHasJobLogConfiguredImportRuleComposite.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public Composite getComposite( Composite parent, ImportRuleInterface importRule ) {
  PropsUI props = PropsUI.getInstance();

  composite = new Composite( parent, SWT.BACKGROUND );
  props.setLook( composite );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = Const.FORM_MARGIN;
  formLayout.marginHeight = Const.FORM_MARGIN;
  composite.setLayout( formLayout );

  // Schema input field...
  //
  Label schemaLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( schemaLabel );
  schemaLabel.setText( "Schema " );
  FormData fdSchemaLabel = new FormData();
  fdSchemaLabel.left = new FormAttachment( 0, 0 );
  fdSchemaLabel.top = new FormAttachment( 0, 0 );
  schemaLabel.setLayoutData( fdSchemaLabel );

  schemaText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( schemaText );
  FormData fdSchemaText = new FormData();
  fdSchemaText.left = new FormAttachment( schemaLabel, Const.MARGIN );
  fdSchemaText.top = new FormAttachment( 0, 0 );
  fdSchemaText.right = new FormAttachment( schemaLabel, 150 );
  schemaText.setLayoutData( fdSchemaText );

  // Table name input field...
  //
  Label tableLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( tableLabel );
  tableLabel.setText( "Table " );
  FormData fdTableLabel = new FormData();
  fdTableLabel.left = new FormAttachment( schemaText, Const.MARGIN );
  fdTableLabel.top = new FormAttachment( 0, 0 );
  tableLabel.setLayoutData( fdTableLabel );

  tableText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( tableText );
  FormData fdTableText = new FormData();
  fdTableText.left = new FormAttachment( tableLabel, Const.MARGIN );
  fdTableText.top = new FormAttachment( 0, 0 );
  fdTableText.right = new FormAttachment( tableLabel, 150 );
  tableText.setLayoutData( fdTableText );

  // Connection name input field...
  //
  Label connectionLabel = new Label( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( connectionLabel );
  connectionLabel.setText( "Connection " );
  FormData fdConnectionLabel = new FormData();
  fdConnectionLabel.left = new FormAttachment( tableText, Const.MARGIN );
  fdConnectionLabel.top = new FormAttachment( 0, 0 );
  connectionLabel.setLayoutData( fdConnectionLabel );

  connectionText = new Text( composite, SWT.SINGLE | SWT.BORDER | SWT.LEFT );
  props.setLook( connectionText );
  FormData fdConnectionText = new FormData();
  fdConnectionText.left = new FormAttachment( connectionLabel, Const.MARGIN );
  fdConnectionText.top = new FormAttachment( 0, 0 );
  fdConnectionText.right = new FormAttachment( connectionLabel, 200 );
  connectionText.setLayoutData( fdConnectionText );

  return composite;
}
 
Example 19
Source File: CiviOutputDialog.java    From civicrm-data-integration with GNU General Public License v3.0 4 votes vote down vote up
private void addOutputTab() {
        wTabFolder = new CTabFolder(shell, SWT.BORDER);
        props.setLook(wTabFolder, Props.WIDGET_STYLE_TAB);

        /*************************************************
         * // CIVICRM OUTPUT TAB
         *************************************************/

        wOutputFieldsTab = new CTabItem(wTabFolder, SWT.NONE);
        wOutputFieldsTab.setText(BaseMessages.getString(PKG, "CiviCrmDialog.OutputFieldsGroup.Title")); //$NON-NLS-1$

        gOutputFields = new Composite(wTabFolder, SWT.NONE);
        props.setLook(gOutputFields);

        FormLayout outputFieldsCompLayout = new FormLayout();
        outputFieldsCompLayout.marginWidth = Const.FORM_MARGIN;
        outputFieldsCompLayout.marginHeight = Const.FORM_MARGIN;
        gOutputFields.setLayout(outputFieldsCompLayout);

        // -----------------------------------------------
        /*************************************************
         * // KEY / OUTPUT TABLE
         *************************************************/

        int outputKeyWidgetCols = 3;
        int outputKeyWidgetRows = (((CiviOutputMeta) input).getCiviCrmListingFields() != null ? ((CiviOutputMeta) input).getCiviCrmOutputMap().size()
                : 3);

        ColumnInfo[] ciFields = new ColumnInfo[outputKeyWidgetCols];
        streamFieldColumn = new ColumnInfo(BaseMessages.getString(PKG, "CiviCrmDialog.ColumnInfo.StreamField"), ColumnInfo.COLUMN_TYPE_CCOMBO,
                new String[]{}, false);
        outputFieldsColumn = new ColumnInfo(BaseMessages.getString(PKG, "CiviCrmDialog.ColumnInfo.EntityField"), ColumnInfo.COLUMN_TYPE_CCOMBO,
                new String[]{}, false);
        ciFields[0] = streamFieldColumn;
        ciFields[1] = outputFieldsColumn;
//        ciFields[2] = new ColumnInfo(BaseMessages.getString(PKG, "CiviCrmDialog.ColumnInfo.Source"), ColumnInfo.COLUMN_TYPE_NONE,false);
        ciFields[2] = new ColumnInfo(BaseMessages.getString(PKG, "CiviCrmDialog.ColumnInfo.TitleField"), ColumnInfo.COLUMN_TYPE_NONE,false);

        tOutputFields = new TableView(transMeta, gOutputFields, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL,
                ciFields, outputKeyWidgetRows, lsMod, props);

        FormData fdOutputFields = new FormData();
        fdOutputFields.left = new FormAttachment(0, 0);
        fdOutputFields.top = new FormAttachment(0, margin);
        fdOutputFields.right = new FormAttachment(100, -margin);
        fdOutputFields.bottom = new FormAttachment(100, -margin);
        tOutputFields.setLayoutData(fdOutputFields);

        FormData fdOutputFieldsComp = new FormData();
        fdOutputFieldsComp.left = new FormAttachment(0, 0);
        fdOutputFieldsComp.top = new FormAttachment(0, 0);
        fdOutputFieldsComp.right = new FormAttachment(100, 0);
        fdOutputFieldsComp.bottom = new FormAttachment(100, 0);
        gOutputFields.setLayoutData(fdOutputFieldsComp);

        tOutputFields.setLayoutData(fdOutputFields);

        gOutputFields.layout();

        wOutputFieldsTab.setControl(gOutputFields);


        FormData fdTabFolder = new FormData();
        fdTabFolder.left = new FormAttachment(0, 0);
        fdTabFolder.top = new FormAttachment(gEntity, margin);
        fdTabFolder.right = new FormAttachment(100, 0);
        fdTabFolder.bottom = new FormAttachment(wOK, -margin);
        wTabFolder.setLayoutData(fdTabFolder);

        wTabFolder.setSelection(0);
    }
 
Example 20
Source File: CiviOutputDialog.java    From civicrm-data-integration with GNU General Public License v3.0 4 votes vote down vote up
public String open() {
    Shell parent = getParent();
    Display display = parent.getDisplay();

    shell = new Shell(parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MIN | SWT.MAX);
    props.setLook(shell);
    setShellImage(shell, (CiviOutputMeta) input);

    lsMod = new ModifyListener() {
        public void modifyText(ModifyEvent e) {
            ((CiviOutputMeta) input).setChanged();
        }
    };
    backupChanged = ((CiviOutputMeta) input).hasChanged();

    FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = Const.FORM_MARGIN;
    formLayout.marginHeight = Const.FORM_MARGIN;

    shell.setLayout(formLayout);
    shell.setText(BaseMessages.getString(PKG, "CiviCrmDialog.Shell.Output.Title"));

    middle = props.getMiddlePct();
    margin = Const.MARGIN;

    /*************************************************
     * STEP NAME ENTRY
     *************************************************/

    // Stepname line
    wlStepname = new Label(shell, SWT.RIGHT);
    wlStepname.setText(BaseMessages.getString(PKG, "System.Label.StepName"));
    props.setLook(wlStepname);
    fdlStepname = new FormData();
    fdlStepname.left = new FormAttachment(0, 0);
    fdlStepname.right = new FormAttachment(middle, -margin);
    fdlStepname.top = new FormAttachment(0, margin);
    wlStepname.setLayoutData(fdlStepname);

    wStepname = new Text(shell, SWT.SINGLE | SWT.LEFT | SWT.BORDER);
    wStepname.setText(stepname);
    props.setLook(wStepname);
    wStepname.addModifyListener(lsMod);
    fdStepname = new FormData();
    fdStepname.left = new FormAttachment(middle, 0);
    fdStepname.top = new FormAttachment(0, margin);
    fdStepname.right = new FormAttachment(100, 0);
    wStepname.setLayoutData(fdStepname);

    addOkCancelButtons();
    addConnectionTab();
    addEntityGroup();
    addOutputTab();

    // wGetInputFields.addListener(SWT.Selection, lsGetInputFields);
    /*************************************************
     * // DEFAULT ACTION LISTENERS
     *************************************************/

    lsDef = new SelectionAdapter() {
        public void widgetDefaultSelected(SelectionEvent e) {
            ok();
        }
    };
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener(new ShellAdapter() {
        public void shellClosed(ShellEvent e) {
            cancel();
        }
    });

    // Set the shell size, based upon previous time...
    setSize();

    /*************************************************
     * // POPULATE AND OPEN DIALOG
     *************************************************/

    getData();
    ((CiviOutputMeta) input).setChanged(backupChanged);

    shell.open();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch())
            display.sleep();
    }
    return stepname;
}