Java Code Examples for org.eclipse.swt.widgets.Button#setVisible()

The following examples show how to use org.eclipse.swt.widgets.Button#setVisible() . 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: InvoiceCorrectionWizardDialog.java    From elexis-3-core with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected void createButtonsForButtonBar(Composite parent){
	// TODO Auto-generated method stub
	super.createButtonsForButtonBar(parent);

	Button finish = getButton(IDialogConstants.FINISH_ID);
	finish.setText("Fertigstellen");
	finish.setVisible(true);
    setButtonLayoutData(finish);
	
	Button back = getButton(IDialogConstants.BACK_ID);
	back.setVisible(false);
	
	Button cancel = getButton(IDialogConstants.CANCEL_ID);
	cancel.setText("Abbrechen");
	
	Button btnCreateInvoice = getButton(IDialogConstants.NEXT_ID);
	btnCreateInvoice.setText("Rechnungskorrektur durchführen");
	setButtonLayoutData(btnCreateInvoice);
	
	cancel.moveBelow(null);
	finish.moveAbove(cancel);
	btnCreateInvoice.moveAbove(finish);
	back.moveAbove(btnCreateInvoice);
	
}
 
Example 2
Source File: SeriesPaletteSheet.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public Composite getComponent( Composite parent )
{
	ChartUIUtil.bindHelp( parent, ChartHelpContextIds.POPUP_SERIES_PALETTE );
	// Sheet content composite
	cmpContent = new Composite( parent, SWT.NONE );
	{
		// Layout for the content composite
		GridLayout glContent = new GridLayout( );
		glContent.marginHeight = 7;
		glContent.marginWidth = 7;
		cmpContent.setLayout( glContent );
	}

	btnAutoPals = new Button( cmpContent, SWT.CHECK );
	btnAutoPals.setText( Messages.getString("SeriesPaletteSheet.Label.Auto") ); //$NON-NLS-1$
	btnAutoPals.addSelectionListener( this );
	btnAutoPals.setVisible( context.getUIFactory( ).supportAutoUI( ) );
	
	// Palete composite
	createPaletteUI( cmpContent );
	updateUIStatus( );
	cmpContent.pack( );
	return cmpContent;
}
 
Example 3
Source File: JavaCamelJobScriptsExportWSWizardPage.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
private void createOptionsForDocker(Composite optionsGroup, Font font) {
    if (!PluginChecker.isTIS()) {
        return;
    }

    // TESB-17856: ESB Microservice can be exported only with Default context
    contextButton = new Button(optionsGroup, SWT.CHECK | SWT.LEFT);
    contextButton.setText("Only export the default context"); //$NON-NLS-1$
    contextButton.setFont(font);
    contextButton.setVisible(PluginChecker.isTIS());
    contextButton.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            onlyExportDefaultContext = contextButton.getSelection();
        }
    });

    optionsGroupCompositeLayout = (GridData) optionsGroup.getParent().getLayoutData();
}
 
Example 4
Source File: AttributeListPanel.java    From Rel with Apache License 2.0 6 votes vote down vote up
private void addRow(String name, int rowNum, boolean last, boolean selected) {
	Label lblNewLabel = new Label(this, SWT.NONE);
	lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	lblNewLabel.setText(name);
	labelAttributes.add(lblNewLabel);

	Button checkBox = new Button(this, SWT.CHECK);
	checkBox.setSelection(selected);
	checkAttributes.add(checkBox);

	Composite buttonPanel = new Composite(this, SWT.NONE);
	buttonPanel.setLayout(new FillLayout(SWT.HORIZONTAL));
	Button btnUp = new Button(buttonPanel, SWT.ARROW | SWT.UP | SWT.ARROW_UP);
	btnUp.addListener(SWT.Selection, e -> moveAttributeRow(rowNum, rowNum - 1));
	btnUp.setVisible(!(rowNum == 0));
	Button btnDown = new Button(buttonPanel, SWT.ARROW | SWT.DOWN | SWT.ARROW_DOWN);
	btnDown.addListener(SWT.Selection, e -> moveAttributeRow(rowNum, rowNum + 1));
	btnDown.setVisible(!last);
}
 
Example 5
Source File: SorterPanel.java    From Rel with Apache License 2.0 6 votes vote down vote up
private void addRow(SorterPanel.SortedAttribute attribute, int rowNum, boolean last) {
	Label lblNewLabel = new Label(this, SWT.NONE);
	lblNewLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	lblNewLabel.setText(attribute.getName());
	labelAttributes.add(lblNewLabel);

	SortOrderPicker ordering = new SortOrderPicker(this, SWT.NONE);
	ordering.setState(attribute.getSort());
	orderAttributes.add(ordering);

	Composite buttonPanel = new Composite(this, SWT.NONE);
	buttonPanel.setLayout(new FillLayout(SWT.HORIZONTAL));
	Button btnUp = new Button(buttonPanel, SWT.ARROW | SWT.UP | SWT.ARROW_UP);
	btnUp.addListener(SWT.Selection, e -> moveAttributeRow(rowNum, rowNum - 1));
	btnUp.setVisible(!(rowNum == 0));
	btnUp.setToolTipText("Move up; increase sort priority.");
	
	Button btnDown = new Button(buttonPanel, SWT.ARROW | SWT.DOWN | SWT.ARROW_DOWN);
	btnDown.addListener(SWT.Selection, e -> moveAttributeRow(rowNum, rowNum + 1));
	btnDown.setVisible(!last);
	btnDown.setToolTipText("Move down; decrease sort priority.");
}
 
Example 6
Source File: DotExportRadioGroupFieldEditor.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
protected void hideOpenExportedFileBooleanFieldEditor() {
	// hide the open exported file automatically boolean field editor
	Button checkBox = openExportedFileBooleanFieldEditor
			.getChangeControl(parent);
	checkBox.setVisible(false);
	((GridData) checkBox.getLayoutData()).exclude = true;
}
 
Example 7
Source File: CustomPreviewTable.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void addHeaderButton( int style, String sColumnHeading, int iWidth )
{
	Button btnHeader = new Button( cmpHeaders, style );
	FormData fd = new FormData( );
	fd.top = new FormAttachment( 2 );
	int i = btnHeaders.size( );
	if ( i == 0 )
	{
		fd.left = new FormAttachment( 0 );
	}
	else
	{
		Button btnNeighbor = btnHeaders.get( i - 1 );
		fd.left = new FormAttachment( btnNeighbor, SPLITTER_WIDTH );
	}
	fd.width = iWidth - SPLITTER_WIDTH;
	// fd.height = HEADER_HEIGHT;
	btnHeader.setLayoutData( fd );
	btnHeader.setText( sColumnHeading );
	btnHeader.setVisible( true );
	btnHeader.addListener( SWT.Selection, headerButtonListener );
	btnHeader.addKeyListener( this );
	btnHeader.addTraverseListener( traverseListener );
	btnHeader.addListener( SWT.FocusIn, headerButtonListener );
	btnHeader.addMouseListener( this );
	btnHeader.addMouseMoveListener( this );
	// Add drag support
	addDragListenerToHeaderButton( btnHeader );

	btnHeaders.add( btnHeader );

	// create menu
	fireMenuEvent( btnHeader, false );

	// Use this splitter to resize the column
	addHeaderSplitter( );
}
 
Example 8
Source File: DotExportRadioGroupFieldEditor.java    From gef with Eclipse Public License 2.0 5 votes vote down vote up
protected void showOpenExportedFileBooleanFieldEditor() {
	// show the open exported file automatically boolean field editor
	Button checkBox = openExportedFileBooleanFieldEditor
			.getChangeControl(parent);
	checkBox.setVisible(true);
	((GridData) checkBox.getLayoutData()).exclude = false;
}
 
Example 9
Source File: UpdateDialog.java    From offspring with MIT License 4 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
  Composite container = (Composite) super.createDialogArea(parent);

  GridLayout layout = new GridLayout(1, false);
  layout.horizontalSpacing = 15;
  layout.marginTop = 10;
  layout.marginLeft = 10;

  GridData gd = new GridData(GridData.FILL, GridData.FILL, false, true);
  gd.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);

  mainContainer = new Composite(container, SWT.NONE);
  mainContainer.setLayoutData(gd);
  mainContainer.setLayout(layout);

  messageLabel = new Label(mainContainer, SWT.WRAP);
  messageLabel.setText("...");
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.FILL).grab(true, false)
      .applyTo(messageLabel);

  installButton = new Button(mainContainer, SWT.PUSH);
  installButton.setText("Install Updates");
  installButton.setVisible(false);
  installButton.addSelectionListener(new SelectionAdapter() {

    @Override
    public void widgetSelected(SelectionEvent e) {
      installUpdates = true;
      hideInstallButton();
    }
  });
  GridDataFactory.swtDefaults().exclude(true).applyTo(installButton);

  progressBarComposite = new Composite(mainContainer, SWT.NONE);
  progressBarComposite.setVisible(false);
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, true)
      .exclude(true).applyTo(progressBarComposite);
  GridLayoutFactory.fillDefaults().numColumns(1)
      .applyTo(progressBarComposite);

  progressBar = new ProgressIndicator(progressBarComposite, SWT.SMOOTH);
  GridDataFactory.fillDefaults().grab(true, true).align(SWT.FILL, SWT.FILL)
      .applyTo(progressBar);

  mainContainer.layout();
  return container;
}
 
Example 10
Source File: ConfigOptionController.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
@Override
public Control createControl(Composite subComposite, IElementParameter param, int numInRow, int nbInRow, int top,
        Control lastControl) {

    Button theBtn = getWidgetFactory().createButton(subComposite, "", SWT.PUSH); //$NON-NLS-1$
    theBtn.setBackground(subComposite.getBackground());
    if (param.getDisplayName().equals("")) { //$NON-NLS-1$
        theBtn.setImage(ImageProvider.getImage(CoreUIPlugin.getImageDescriptor(DOTS_BUTTON)));
    } else {
        theBtn.setText(param.getDisplayName());
    }
    FormData data = new FormData();
    if (isInWizard()) {
        if (lastControl != null) {
            data.right = new FormAttachment(lastControl, 0);
        } else {
            data.right = new FormAttachment(100, -ITabbedPropertyConstants.HSPACE);
        }
    } else {
        if (lastControl != null) {
            data.left = new FormAttachment(lastControl, 0);
        } else {
            data.left = new FormAttachment((((numInRow - 1) * MAX_PERCENT) / nbInRow), 0);
        }
    }
    data.top = new FormAttachment(0, top);
    theBtn.setLayoutData(data);
    theBtn.setEnabled(!param.isReadOnly());
    theBtn.setData(param);
    hashCurControls.put(param.getName(), theBtn);
    theBtn.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(SelectionEvent e) {
            Command cmd = createCommand((Button) e.getSource());
            executeCommand(cmd);
        }
    });
    Point initialSize = theBtn.computeSize(SWT.DEFAULT, SWT.DEFAULT);
    dynamicProperty.setCurRowSize(initialSize.y + ITabbedPropertyConstants.VSPACE);

    if (nexusServerBean == null) {
        theBtn.setVisible(false);
    }

    Display.getDefault().asyncExec(new Runnable() {

        @Override
        public void run() {
            refresh(param, true);
        }

    });

    return theBtn;
}
 
Example 11
Source File: CustomPreviewTable.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void addHeaderButton( int style, ColumnBindingInfo columnHeader,
		int iWidth , int index)
{
	Button btnHeader = new Button( cmpHeaders, style );
	
	btnHeader.setText( columnHeader.getName( ) );
	if ( columnHeader.getImageName( ) != null )
	{
		btnHeader.setImage( UIHelper.getImage( columnHeader.getImageName( ) ) );
	}
	if ( columnHeader.getTooltip( ) != null )
	{
		btnHeader.setToolTipText( columnHeader.getTooltip( ) );
	}
	
	FormData fd = new FormData( );
	fd.top = new FormAttachment( 2 );
	int i = btnHeaders.size( );
	if ( i == 0 )
	{
		fd.left = new FormAttachment( 0 );
	}
	else
	{
		Button btnNeighbor = btnHeaders.get( i - 1 );
		fd.left = new FormAttachment( btnNeighbor, SPLITTER_WIDTH );
	}
	int defaultWidth = iWidth - SPLITTER_WIDTH;
	int preferWidth = btnHeader.computeSize( SWT.DEFAULT, SWT.DEFAULT ).x;
	if ( preferWidth > defaultWidth )
	{
		fd.width = preferWidth;
		columnWidths.remove( index );
		columnWidths.add( index, Integer.valueOf( preferWidth + SPLITTER_WIDTH ) );
	}
	else
	{
		fd.width = defaultWidth;
	}
	// fd.height = HEADER_HEIGHT;
	int h = ChartUIUtil.getImageButtonDefaultHeightByPlatform( );
	if ( h > 0 )
	{
		fd.height = h;
	}
	btnHeader.setLayoutData( fd );

	btnHeader.setVisible( true );
	btnHeader.addListener( SWT.Selection, headerButtonListener );
	btnHeader.addKeyListener( this );
	btnHeader.addTraverseListener( traverseListener );
	btnHeader.addListener( SWT.FocusIn, headerButtonListener );
	btnHeader.addMouseListener( this );
	btnHeader.addMouseMoveListener( this );
	// Add drag support
	addDragListenerToHeaderButton( btnHeader );

	btnHeaders.add( btnHeader );

	// create menu
	fireMenuEvent( btnHeader, false );

	// Use this splitter to resize the column
	addHeaderSplitter( );
}
 
Example 12
Source File: ReportDocumentEditor.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void createErrorControl( Composite parent )
{
	Color bgColor = parent.getDisplay( )
			.getSystemColor( SWT.COLOR_LIST_BACKGROUND );
	Color fgColor = parent.getDisplay( )
			.getSystemColor( SWT.COLOR_LIST_FOREGROUND );

	parent.setBackground( bgColor );
	parent.setForeground( fgColor );

	GridLayout layout = new GridLayout( );

	layout.numColumns = 3;

	int spacing = 8;
	int margins = 8;
	layout.marginBottom = margins;
	layout.marginTop = margins;
	layout.marginLeft = margins;
	layout.marginRight = margins;
	layout.horizontalSpacing = spacing;
	layout.verticalSpacing = spacing;
	parent.setLayout( layout );

	Label imageLabel = new Label( parent, SWT.NONE );
	imageLabel.setBackground( bgColor );
	Image image = getImage( );
	if ( image != null )
	{
		image.setBackground( bgColor );
		imageLabel.setImage( image );
		imageLabel.setLayoutData( new GridData( GridData.HORIZONTAL_ALIGN_CENTER
				| GridData.VERTICAL_ALIGN_BEGINNING ) );
	}

	Text text = new Text( parent, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP );
	text.setBackground( bgColor );
	text.setForeground( fgColor );

	// text.setForeground(JFaceColors.getErrorText(text.getDisplay()));
	text.setLayoutData( new GridData( SWT.FILL, SWT.CENTER, true, false ) );
	text.setText( Messages.getString("ReportDocumentEditor.errorMessage") ); //$NON-NLS-1$

	detailsButton = new Button( parent, SWT.PUSH );
	detailsButton.addSelectionListener( new SelectionAdapter( ) {

		public void widgetSelected( SelectionEvent e )
		{
			showDetails( !showingDetails );
		}
	} );

	detailsButton.setLayoutData( new GridData( SWT.BEGINNING,
			SWT.CENTER,
			false,
			false ) );
	detailsButton.setVisible( e != null );

	updateDetailsText( );

	detailsArea = new Composite( parent, SWT.NONE );
	detailsArea.setBackground( bgColor );
	detailsArea.setForeground( fgColor );
	GridData data = new GridData( GridData.FILL_BOTH );
	data.horizontalSpan = 3;
	data.verticalSpan = 1;
	detailsArea.setLayoutData( data );
	detailsArea.setLayout( new FillLayout( ) );
	parent.layout( true );
}
 
Example 13
Source File: EnterXMPPAccountComposite.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
public EnterXMPPAccountComposite(Composite composite, int style) {
  super(composite, style);
  super.setLayout(new GridLayout(2, false));

  SarosPluginContext.initComponent(this);

  /*
   * Row 1: JID
   */
  Label jidLabel = new Label(this, SWT.NONE);
  jidLabel.setText(Messages.jid_shortform);

  Combo combo = new Combo(this, SWT.BORDER);
  combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  this.jidCombo = new JIDCombo(combo);

  /*
   * Row 2: Password
   */
  Label passwordLabel = new Label(this, SWT.NONE);
  passwordLabel.setText("Password");

  passwordText = new Text(this, SWT.BORDER);
  passwordText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  passwordText.setEchoChar('*');

  /*
   * Row 3: Server Options
   */
  new Label(this, SWT.NONE);

  serverOptionsExpandableComposite =
      new ExpandableComposite(
          this, SWT.NONE, ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT);

  serverOptionsExpandableComposite.setText("Advanced Options");
  serverOptionsExpandableComposite.addExpansionListener(
      new ExpansionAdapter() {
        @Override
        public void expansionStateChanged(ExpansionEvent e) {
          getParent().layout();
        }
      });

  createServerExpandableCompositeContent();

  /*
   * Row 4: Create Account Button
   */

  createAccountButton = new Button(this, SWT.PUSH);
  createAccountButton.setText(Messages.ConfigurationWizard_button_create_account);
  createAccountButton.setVisible(CreateXMPPAccountWizard.CREATE_DIALOG_ENABLED);

  hookListeners();
}
 
Example 14
Source File: CreateXMPPAccountWizardPage.java    From saros with GNU General Public License v2.0 4 votes vote down vote up
private Composite createLeftColumn(Composite composite) {
  Composite leftColumn = new Composite(composite, SWT.NONE);
  leftColumn.setLayout(new GridLayout(2, false));

  /*
   * Row 1
   */
  Label serverLabel = new Label(leftColumn, SWT.NONE);
  serverLabel.setText(Messages.CreateXMPPAccountWizardPage_label_server);

  serverText = new Combo(leftColumn, SWT.BORDER);
  serverText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  /*
   * Row 2
   */
  Label usernameLabel = new Label(leftColumn, SWT.NONE);
  usernameLabel.setText(Messages.CreateXMPPAccountWizardPage_label_username);

  usernameText = new Text(leftColumn, SWT.BORDER);
  usernameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  /*
   * Row 3
   */
  Label passwordLabel = new Label(leftColumn, SWT.NONE);
  passwordLabel.setText(Messages.CreateXMPPAccountWizardPage_label_password);

  passwordText = new Text(leftColumn, SWT.BORDER);
  passwordText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  passwordText.setEchoChar('*');

  /*
   * Row 4
   */
  Label repeatPasswordLabel = new Label(leftColumn, SWT.NONE);
  repeatPasswordLabel.setText(Messages.CreateXMPPAccountWizardPage_label_repeat_password);

  repeatPasswordText = new Text(leftColumn, SWT.BORDER);
  repeatPasswordText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  repeatPasswordText.setEchoChar('*');

  /*
   * Row 5
   */
  Composite spacer = new Composite(leftColumn, SWT.NONE);
  spacer.setLayoutData(new GridData(SWT.BEGINNING, SWT.TOP, false, false, 1, 2));

  useNowButton = new Button(leftColumn, SWT.CHECK | SWT.SEPARATOR);
  useNowButton.setSelection(false);
  useNowButton.setText(Messages.CreateXMPPAccountWizardPage_button_use_new_account);
  useNowButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  useNowButton.setVisible(this.showUseNowButton);

  return leftColumn;
}
 
Example 15
Source File: WorkspaceMergeDialog.java    From MergeProcessor with Apache License 2.0 4 votes vote down vote up
/**
 * {@inheritDoc}
 */
@Override
protected void finishedRun() {
	clearCursors();

	if (isConfirmCommit) {
		((RowData) buttonConfirmCommit.getLayoutData()).exclude = false;
		buttonConfirmCommit.setVisible(true);
	}

	if (commitButton.getListeners(SWT.Selection).length > 1) {
		commitButton.setVisible(true);
		((GridData) commitButton.getLayoutData()).exclude = false;
		if (isConfirmCommit) {
			commitButton.setEnabled(false);
		}
	}

	if (openButton.getListeners(SWT.Selection).length > 1) {
		openButton.setVisible(true);
		((GridData) openButton.getLayoutData()).exclude = false;
	}

	if (openWorkingCopyButton.getListeners(SWT.Selection).length > 1) {
		openWorkingCopyButton.setVisible(true);
		((GridData) openWorkingCopyButton.getLayoutData()).exclude = false;
	}

	if (openTortoiseSvnButton.getListeners(SWT.Selection).length > 1) {
		openTortoiseSvnButton.setVisible(true);
		((GridData) openTortoiseSvnButton.getLayoutData()).exclude = false;
	}

	closeButton.setVisible(true);
	((GridData) closeButton.getLayoutData()).exclude = false;

	final Button cancelButton = getButton(IDialogConstants.CANCEL_ID);
	cancelButton.setVisible(false);
	((GridData) cancelButton.getLayoutData()).exclude = true;

	if (warningsTableViewer.getList().getItemCount() > 0) {
		((GridData) warningsTableViewer.getList().getParent().getLayoutData()).exclude = false;
		warningsTableViewer.getList().setVisible(true);
	}

	final Point size = getShell().computeSize(SWT.DEFAULT, SWT.DEFAULT);
	getShell().setSize(size);
	getShell().layout(true, true);
}
 
Example 16
Source File: RnDialogs.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
@SuppressWarnings("unchecked")
@Override
protected Control createDialogArea(Composite parent){
	lo = Extensions.getClasses(ExtensionPointConstantsData.RECHNUNGS_MANAGER, "outputter"); //$NON-NLS-1$ //$NON-NLS-2$
	if (lo.isEmpty()) {
		String msg = "Elexis has no textplugin configured for outputting bills!"; //$NON-NLS-1$ 
		SWTHelper.alert(msg, msg);
		return null;
	}
	Composite ret = new Composite(parent, SWT.NONE);
	ret.setLayout(new GridLayout());
	Label lbLocal = new Label(ret, SWT.NONE);
	lbLocal.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
	lbLocal.setText(Messages.RnDialogs_stornoOnlyLocal); //$NON-NLS-1$
	for (IRnOutputter rno : lo) {
		if (rno.canStorno(null) && hasTrace(rno.getDescription())) {
			Button cbStorno = new Button(ret, SWT.CHECK);
			cbStorno.setData(rno);
			cbStorno.setText(rno.getDescription());
			cbStorno.setLayoutData(SWTHelper.getFillGridData(1, true, 1, false));
			cbStorno.setSelection(true);
			exporters.add(cbStorno);
		}
	}
	if (exporters.size() > 0) {
		lbLocal.setText(Messages.RnDialogs_stornoPropagate); //$NON-NLS-1$
	}
	new Label(ret, SWT.SEPARATOR | SWT.HORIZONTAL).setLayoutData(SWTHelper.getFillGridData(
		1, false, 1, false));
	
	bReactivate = new Button(ret, SWT.CHECK);
	bReactivate.setText(Messages.RnDialogs_reactivateConsultations); //$NON-NLS-1$
	bReactivate.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	bReactivate.setSelection(true);
	
	if (alwaysReactive) {
		bReactivate.setVisible(false);
	}
	
	/*
	 * bYes=new Button(ret,SWT.RADIO); bNo=new Button(ret,SWT.RADIO);
	 * bYes.setText(Messages.getString("RnDialogs.yes")); //$NON-NLS-1$
	 * bNo.setText(Messages.getString("RnDialogs.no")); //$NON-NLS-1$
	 */
	ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	return ret;
}
 
Example 17
Source File: WarningDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public void open() {
  Shell parent = getParent();
  Display display = parent.getDisplay();

  shell = new Shell( parent, SWT.DIALOG_TRIM | SWT.APPLICATION_MODAL | SWT.SHEET | SWT.RESIZE );
  shell.setImage( GUIResource.getInstance().getImageSpoon() );
  shell.setLayout( new FormLayout() );
  shell.setText( title );
  props.setLook( shell );

  Label wlImage = new Label( shell, SWT.NONE );
  wlImage.setImage( GUIResource.getInstance().getImageWarning32() );
  FormData fdWarnImage = new FormData();
  fdWarnImage.left = new FormAttachment( 0, 15 );
  fdWarnImage.top = new FormAttachment( 0, 15 );
  fdWarnImage.height = 32;
  fdWarnImage.width = 32;
  wlImage.setLayoutData( fdWarnImage );
  props.setLook( wlImage );

  Label wlMessage = new Label( shell, SWT.FLAT  | SWT.WRAP );
  wlMessage.setText( message );
  FormData fdMessage = new FormData();
  fdMessage.left = new FormAttachment( wlImage, 15, SWT.RIGHT );
  fdMessage.right = new FormAttachment( 100, -15 );
  fdMessage.top = new FormAttachment( wlImage, 0, SWT.TOP );
  wlMessage.setLayoutData( fdMessage );
  props.setLook( wlMessage );


  Button spacer = new Button( shell, SWT.NONE );
  FormData fdSpacer = new FormData();
  fdSpacer.right = new FormAttachment( 100, 0 );
  fdSpacer.bottom = new FormAttachment( 100, -15 );
  fdSpacer.left = new FormAttachment( 100, -11 );
  fdSpacer.top = new FormAttachment( wlMessage, 15, SWT.BOTTOM );
  spacer.setLayoutData( fdSpacer );
  spacer.setVisible( false );
  props.setLook( spacer );

  Control attachTo = spacer;
  for ( String label : listenerMap.keySet() ) {
    Button wButton = new Button( shell, SWT.PUSH );
    wButton.setText( label );
    FormData fdButton = new FormData();
    fdButton.right = new FormAttachment( attachTo, -Const.MARGIN, SWT.LEFT );
    fdButton.bottom = new FormAttachment( attachTo, 0, SWT.BOTTOM );
    wButton.setLayoutData( fdButton );
    wButton.addListener( SWT.Selection, listenAndDispose( listenerMap.get( label ) ) );
    props.setLook( wButton );
    attachTo = wButton;
  }
  Point point = shell.computeSize( 436, SWT.DEFAULT );
  shell.setSize( point );
  shell.open();
  while ( !shell.isDisposed() ) {
    if ( !display.readAndDispatch() ) {
      display.sleep();
    }
  }
}