Java Code Examples for org.eclipse.swt.SWT#MAX

The following examples show how to use org.eclipse.swt.SWT#MAX . 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: PipelineRunConfigurationDialog.java    From hop with Apache License 2.0 7 votes vote down vote up
public static void main( String[] args ) throws HopException {
  Display display = new Display();
  Shell shell = new Shell( display, SWT.MIN | SWT.MAX | SWT.RESIZE );

  HopClientEnvironment.init();
  HopEnvironment.init();
  HopGuiEnvironment.init();
  // LocalWorkflowRunConfiguration localConfig = new LocalWorkflowRunConfiguration( "Local", "Local pipeline engine", "5000" );
  PipelineRunConfiguration configuration = new PipelineRunConfiguration( "test", "A test run config", new ArrayList<>(), null );
  PipelineRunConfigurationDialog dialog = new PipelineRunConfigurationDialog( shell, null, configuration );
  String name = dialog.open();
  if ( name != null ) {
    // Re-open with a new dialog...
    //
    PipelineRunConfigurationDialog newDialog = new PipelineRunConfigurationDialog( shell, null, configuration );
    newDialog.open();
  }

  display.dispose();
}
 
Example 2
Source File: KettleDatabaseRepositoryDialog.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
public KettleDatabaseRepositoryDialog( Shell parent, int style,
                                       RepositoryMeta repositoryMeta,
                                       RepositoriesMeta repositoriesMeta ) {
  this.display = parent.getDisplay();
  this.props = PropsUI.getInstance();
  this.input = (KettleDatabaseRepositoryMeta) repositoryMeta;
  this.repositories = repositoriesMeta;
  this.masterRepositoriesMeta = repositoriesMeta.clone();
  this.masterRepositoryName = repositoryMeta.getName();

  shell =
      new Shell( parent, style | SWT.DIALOG_TRIM | SWT.RESIZE
              | SWT.MAX | SWT.MIN | SWT.APPLICATION_MODAL | SWT.SHEET );
  shell.setText( BaseMessages.getString( PKG, "RepositoryDialog.Dialog.Main.Title" ) );

}
 
Example 3
Source File: PropsUI.java    From pentaho-kettle with Apache License 2.0 6 votes vote down vote up
private int parseStyle( String sStyle ) {
  int style = SWT.DIALOG_TRIM;
  String[] styles = sStyle.split( "," );
  for ( String style1 : styles ) {
    if ( "APPLICATION_MODAL".equals( style1 ) ) {
      style |= SWT.APPLICATION_MODAL | SWT.SHEET;
    } else if ( "RESIZE".equals( style1 ) ) {
      style |= SWT.RESIZE;
    } else if ( "MIN".equals( style1 ) ) {
      style |= SWT.MIN;
    } else if ( "MAX".equals( style1 ) ) {
      style |= SWT.MAX;
    }
  }

  return style;
}
 
Example 4
Source File: GraphModelDialog.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 6 votes vote down vote up
public GraphModelDialog( Shell parent, GraphModel graphModel, RowMetaInterface inputRowMeta ) {
  super( parent, SWT.DIALOG_TRIM | SWT.MIN | SWT.MAX | SWT.CLOSE );
  this.inputRowMeta = inputRowMeta;

  props = PropsUI.getInstance();
  ok = false;

  // We will only replace at OK
  //
  this.originalGraphModel = graphModel;

  // We will change graphModel, copy it first
  //
  this.graphModel = new GraphModel( graphModel );

  mouseDownPoint = new Point( -1, -1 );
}
 
Example 5
Source File: CommonTransformDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
private Display prepareLayout() {

    // Prep the parent shell and the dialog shell
    final Shell parent = getParent();
    final Display display = parent.getDisplay();

    shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
    props.setLook( shell );
    setShellImage( shell, meta );
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener( new ShellAdapter() {
      @Override
      public void shellClosed( ShellEvent e ) {
        cancel();
      }
    } );

    changed = meta.hasChanged();

    final FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = BaseDialog.MARGIN_SIZE;
    formLayout.marginHeight = BaseDialog.MARGIN_SIZE;

    shell.setLayout( formLayout );
    shell.setText( getTitle() );
    return display;
  }
 
Example 6
Source File: BaseMdiEntry.java    From BiglyBT with GNU General Public License v2.0 5 votes vote down vote up
public static void
popoutStandAlone(
	String						title,
	Map<String,Object>			state,
	String						configPrefix )
{
	SkinnedDialog skinnedDialog =
			new SkinnedDialog(
					"skin3_dlg_sidebar_popout",
					"shell",
					null,	// standalone
					SWT.RESIZE | SWT.MAX | SWT.DIALOG_TRIM);

	SWTSkin skin = skinnedDialog.getSkin();

	SWTSkinObjectContainer cont = 
		BaseMdiEntry.importStandAlone(
			(SWTSkinObjectContainer)skin.getSkinObject( "content-area" ), 
			state,
			null );

	if ( cont != null ){

		skinnedDialog.setTitle( title );

		skinnedDialog.open( configPrefix, true );

	}else{

		skinnedDialog.close();
	}
}
 
Example 7
Source File: ConfigurationDialog.java    From hop with Apache License 2.0 5 votes vote down vote up
protected void mainLayout( String shellTitle, Image img ) {
  display = parent.getDisplay();
  shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX );
  props.setLook( shell );
  shell.setImage( img );
  shell.setLayout( new FormLayout() );
  shell.setText( shellTitle );
}
 
Example 8
Source File: MainView.java    From Universal-FE-Randomizer with MIT License 5 votes vote down vote up
public MainView(Display mainDisplay) {
	super();
	
	Shell shell = new Shell(mainDisplay, SWT.SHELL_TRIM & ~SWT.MAX); 
	 shell.setText("Yune: A Universal Fire Emblem Randomizer (v0.9.1)");
	 shell.setImage(new Image(mainDisplay, Main.class.getClassLoader().getResourceAsStream("YuneIcon.png")));
	 
	 screenHeight = mainDisplay.getBounds().height;
	 for (Monitor monitor : mainDisplay.getMonitors()) {
		 screenHeight = Math.max(screenHeight, monitor.getClientArea().height);
	 }
	 
	 screenHeight -= 20;
	 
	 mainShell = shell;
	 
	 setupMainShell();
	 
	 resize();
	 
	 /* Open shell window */
	  mainShell.open();
	  
	  mainDisplay.addFilter(SWT.KeyDown, new Listener() {
		@Override
		public void handleEvent(Event event) {
			if (((event.stateMask & SWT.CTRL) != 0) && ((event.stateMask & SWT.SHIFT) != 0) && (event.keyCode == 'c') && !consoleShellOpened) {
				openConsole();
			}
		}
	  });
}
 
Example 9
Source File: CommonStepDialog.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
private Display prepareLayout() {

    // Prep the parent shell and the dialog shell
    final Shell parent = getParent();
    final Display display = parent.getDisplay();

    shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );
    props.setLook( shell );
    setShellImage( shell, meta );
    // Detect X or ALT-F4 or something that kills this window...
    shell.addShellListener( new ShellAdapter() {
      @Override
      public void shellClosed( ShellEvent e ) {
        cancel();
      }
    } );

    changed = meta.hasChanged();

    final FormLayout formLayout = new FormLayout();
    formLayout.marginWidth = BaseDialog.MARGIN_SIZE;
    formLayout.marginHeight = BaseDialog.MARGIN_SIZE;

    shell.setLayout( formLayout );
    shell.setText( getTitle() );
    return display;
  }
 
Example 10
Source File: Utils.java    From BiglyBT with GNU General Public License v2.0 4 votes vote down vote up
private int calcState(Shell shell) {
	return shell.getMinimized() ? SWT.MIN : shell.getMaximized() ? SWT.MAX : SWT.NONE;
}
 
Example 11
Source File: GraphModelDialog.java    From knowbi-pentaho-pdi-neo4j-output with Apache License 2.0 4 votes vote down vote up
/**
 * @return true when OK is hit, false when CANCEL
 */
public boolean open() {

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

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

  margin = Const.MARGIN + 2;
  middle = Const.MIDDLE_PCT;

  FormLayout formLayout = new FormLayout();

  shell.setLayout( formLayout );
  shell.setText( "Graph Model Editor" );

  Button wOK = new Button( shell, SWT.PUSH );
  wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  wOK.addListener( SWT.Selection, event -> ok() );
  Button wCancel = new Button( shell, SWT.PUSH );
  wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) );
  wCancel.addListener( SWT.Selection, event -> cancel() );

  BaseStepDialog.positionBottomButtons( shell, new Button[] { wOK, wCancel }, margin, null );

  // Add a tab folder
  //
  wTabs = new CTabFolder( shell, SWT.BORDER );
  FormData fdTabs = new FormData();
  fdTabs.left = new FormAttachment( 0, 0 );
  fdTabs.right = new FormAttachment( 100, 0 );
  fdTabs.top = new FormAttachment( 0, 0 );
  fdTabs.bottom = new FormAttachment( wOK, -margin * 2 );
  wTabs.setLayoutData( fdTabs );

  addModelTab();
  addNodesTab();
  addRelationshipsTab();
  addGraphTab();

  // Select the model tab
  //
  wTabs.setSelection( 0 );

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

  getData();

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

  return ok;
}
 
Example 12
Source File: TextFileInputDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void getFixed() {
  TextFileInputMeta info = new TextFileInputMeta();
  getInfo( info, true );

  Shell sh = new Shell( shell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );

  try {
    List<String> rows = getFirst( 50, false );
    fields = getFields( info, rows );

    final TextFileImportWizardPage1 page1 = new TextFileImportWizardPage1( "1", props, rows, fields );
    page1.createControl( sh );
    final TextFileImportWizardPage2 page2 = new TextFileImportWizardPage2( "2", props, rows, fields );
    page2.createControl( sh );

    Wizard wizard = new Wizard() {
      public boolean performFinish() {
        wFields.clearAll( false );

        for ( ITextFileInputField field1 : fields ) {
          BaseFileField field = (BaseFileField) field1;
          if ( !field.isIgnored() && field.getLength() > 0 ) {
            TableItem item = new TableItem( wFields.table, SWT.NONE );
            item.setText( 1, field.getName() );
            item.setText( 2, "" + field.getTypeDesc() );
            item.setText( 3, "" + field.getFormat() );
            item.setText( 4, "" + field.getPosition() );
            item.setText( 5, field.getLength() < 0 ? "" : "" + field.getLength() );
            item.setText( 6, field.getPrecision() < 0 ? "" : "" + field.getPrecision() );
            item.setText( 7, "" + field.getCurrencySymbol() );
            item.setText( 8, "" + field.getDecimalSymbol() );
            item.setText( 9, "" + field.getGroupSymbol() );
            item.setText( 10, "" + field.getNullString() );
            item.setText( 11, "" + field.getIfNullValue() );
            item.setText( 12, "" + field.getTrimTypeDesc() );
            item.setText( 13, field.isRepeated() ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
              .getString( PKG, "System.Combo.No" ) );
          }

        }
        int size = wFields.table.getItemCount();
        if ( size == 0 ) {
          new TableItem( wFields.table, SWT.NONE );
        }

        wFields.removeEmptyRows();
        wFields.setRowNums();
        wFields.optWidth( true );

        input.setChanged();

        return true;
      }
    };

    wizard.addPage( page1 );
    wizard.addPage( page2 );

    WizardDialog wd = new WizardDialog( shell, wizard );
    WizardDialog.setDefaultImage( GuiResource.getInstance().getImageWizard() );
    wd.setMinimumPageSize( 700, 375 );
    wd.updateSize();
    wd.open();
  } catch ( Exception e ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogTitle" ),
      BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogMessage" ), e );
  }
}
 
Example 13
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;
}
 
Example 14
Source File: TextFileInputDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void getFixed() {
  TextFileInputMeta info = new TextFileInputMeta();
  getInfo( info );

  Shell sh = new Shell( shell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );

  try {
    List<String> rows = getFirst( 50, false );
    fields = getFields( info, rows );

    final TextFileImportWizardPage1 page1 = new TextFileImportWizardPage1( "1", props, rows, fields );
    page1.createControl( sh );
    final TextFileImportWizardPage2 page2 = new TextFileImportWizardPage2( "2", props, rows, fields );
    page2.createControl( sh );

    Wizard wizard = new Wizard() {
      public boolean performFinish() {
        wFields.clearAll( false );

        for ( TextFileInputFieldInterface field1 : fields ) {
          TextFileInputField field = (TextFileInputField) field1;
          if ( !field.isIgnored() && field.getLength() > 0 ) {
            TableItem item = new TableItem( wFields.table, SWT.NONE );
            item.setText( 1, field.getName() );
            item.setText( 2, "" + field.getTypeDesc() );
            item.setText( 3, "" + field.getFormat() );
            item.setText( 4, "" + field.getPosition() );
            item.setText( 5, field.getLength() < 0 ? "" : "" + field.getLength() );
            item.setText( 6, field.getPrecision() < 0 ? "" : "" + field.getPrecision() );
            item.setText( 7, "" + field.getCurrencySymbol() );
            item.setText( 8, "" + field.getDecimalSymbol() );
            item.setText( 9, "" + field.getGroupSymbol() );
            item.setText( 10, "" + field.getNullString() );
            item.setText( 11, "" + field.getIfNullValue() );
            item.setText( 12, "" + field.getTrimTypeDesc() );
            item.setText( 13, field.isRepeated() ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
              .getString( PKG, "System.Combo.No" ) );
          }

        }
        int size = wFields.table.getItemCount();
        if ( size == 0 ) {
          new TableItem( wFields.table, SWT.NONE );
        }

        wFields.removeEmptyRows();
        wFields.setRowNums();
        wFields.optWidth( true );

        input.setChanged();

        return true;
      }
    };

    wizard.addPage( page1 );
    wizard.addPage( page2 );

    WizardDialog wd = new WizardDialog( shell, wizard );
    WizardDialog.setDefaultImage( GUIResource.getInstance().getImageWizard() );
    wd.setMinimumPageSize( 700, 375 );
    wd.updateSize();
    wd.open();
  } catch ( Exception e ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogTitle" ),
      BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogMessage" ), e );
  }
}
 
Example 15
Source File: ElasticSearchBulkDialog.java    From pentaho-kettle with Apache License 2.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.MAX | SWT.MIN );
  props.setLook( shell );
  setShellImage( shell, model );

  lsMod = new ModifyListener() {

    public void modifyText( ModifyEvent e ) {
      model.setChanged();
    }
  };

  changed = model.hasChanged();

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

  shell.setLayout( formLayout );
  shell.setText( BaseMessages.getString( PKG, "ElasticSearchBulkDialog.DialogTitle" ) );

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

  // 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.top = new FormAttachment( 0, margin );
  fdlStepname.right = new FormAttachment( middle, -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 );

  wTabFolder = new CTabFolder( shell, SWT.BORDER );
  props.setLook( wTabFolder, Props.WIDGET_STYLE_TAB );

  // GENERAL TAB
  addGeneralTab();

  // Servers TAB
  addServersTab();

  // Fields TAB
  addFieldsTab();

  // Settings TAB
  addSettingsTab();

  // ////////////
  // BUTTONS //
  // //////////
  wOK = new Button( shell, SWT.PUSH );
  wOK.setText( BaseMessages.getString( PKG, "System.Button.OK" ) );
  wCancel = new Button( shell, SWT.PUSH );
  wCancel.setText( BaseMessages.getString( PKG, "System.Button.Cancel" ) );

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

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

  // //////////////////
  // Std Listeners //
  // ////////////////
  addStandardListeners();

  wTabFolder.setSelection( 0 );

  // Set the shell size, based upon previous time...
  setSize();
  getData( model );
  model.setChanged( changed );

  shell.open();
  while ( !shell.isDisposed() ) {
    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  return stepname;
}
 
Example 16
Source File: TextFileInputDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void getFixed() {
  TextFileInputMeta info = new TextFileInputMeta();
  getInfo( info, true );

  Shell sh = new Shell( shell, SWT.DIALOG_TRIM | SWT.RESIZE | SWT.MAX | SWT.MIN );

  try {
    List<String> rows = getFirst( 50, false );
    fields = getFields( info, rows );

    final TextFileImportWizardPage1 page1 = new TextFileImportWizardPage1( "1", props, rows, fields );
    page1.createControl( sh );
    final TextFileImportWizardPage2 page2 = new TextFileImportWizardPage2( "2", props, rows, fields );
    page2.createControl( sh );

    Wizard wizard = new Wizard() {
      public boolean performFinish() {
        wFields.clearAll( false );

        for ( TextFileInputFieldInterface field1 : fields ) {
          BaseFileField field = (BaseFileField) field1;
          if ( !field.isIgnored() && field.getLength() > 0 ) {
            TableItem item = new TableItem( wFields.table, SWT.NONE );
            item.setText( 1, field.getName() );
            item.setText( 2, "" + field.getTypeDesc() );
            item.setText( 3, "" + field.getFormat() );
            item.setText( 4, "" + field.getPosition() );
            item.setText( 5, field.getLength() < 0 ? "" : "" + field.getLength() );
            item.setText( 6, field.getPrecision() < 0 ? "" : "" + field.getPrecision() );
            item.setText( 7, "" + field.getCurrencySymbol() );
            item.setText( 8, "" + field.getDecimalSymbol() );
            item.setText( 9, "" + field.getGroupSymbol() );
            item.setText( 10, "" + field.getNullString() );
            item.setText( 11, "" + field.getIfNullValue() );
            item.setText( 12, "" + field.getTrimTypeDesc() );
            item.setText( 13, field.isRepeated() ? BaseMessages.getString( PKG, "System.Combo.Yes" ) : BaseMessages
                .getString( PKG, "System.Combo.No" ) );
          }

        }
        int size = wFields.table.getItemCount();
        if ( size == 0 ) {
          new TableItem( wFields.table, SWT.NONE );
        }

        wFields.removeEmptyRows();
        wFields.setRowNums();
        wFields.optWidth( true );

        input.setChanged();

        return true;
      }
    };

    wizard.addPage( page1 );
    wizard.addPage( page2 );

    WizardDialog wd = new WizardDialog( shell, wizard );
    WizardDialog.setDefaultImage( GUIResource.getInstance().getImageWizard() );
    wd.setMinimumPageSize( 700, 375 );
    wd.updateSize();
    wd.open();
  } catch ( Exception e ) {
    new ErrorDialog( shell, BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogTitle" ),
        BaseMessages.getString( PKG, "TextFileInputDialog.ErrorShowingFixedWizard.DialogMessage" ), e );
  }
}
 
Example 17
Source File: ExpressionBuilder.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
protected void setShellStyle( int newShellStyle )
{
	newShellStyle |= SWT.MAX | SWT.RESIZE;
	super.setShellStyle( newShellStyle );
}
 
Example 18
Source File: SWTWindow.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public SWTWindow(SWTWindow parent, boolean modal, boolean resizable) {
	this(new Shell(parent.getControl(), SWT.DIALOG_TRIM | (modal ? SWT.APPLICATION_MODAL : 0) | (resizable ? SWT.RESIZE | SWT.MAX : 0)), parent);
}
 
Example 19
Source File: InfobrightLoaderDialog.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, (StepMetaInterface) 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, "InfobrightLoaderDialog.Shell.Title" ) );

  middle = props.getMiddlePct();

  int margin = Const.MARGIN;

  /************************************** Step name line ***************************/
  // label
  wlStepname = new Label( shell, SWT.RIGHT );
  wlStepname.setText( BaseMessages.getString( PKG, "InfobrightLoaderDialog.Stepname.Label" ) );
  wlStepname.setLayoutData( standardLabelSpacing( 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 ) );
  props.setLook( wStepname );

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

  addVerticalPadding( 2 * margin );

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

  getData();
  input.setChanged( changed );

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

    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
  return stepname;
}
 
Example 20
Source File: SWTWindow.java    From tuxguitar with GNU Lesser General Public License v2.1 4 votes vote down vote up
public void maximize() {
	if((this.getControl().getStyle() & SWT.MAX) != 0) {
		this.getControl().setMaximized(true);
	}
}