Java Code Examples for org.eclipse.swt.widgets.Text.setLayoutData()

The following are Jave code examples for showing how to use setLayoutData() of the org.eclipse.swt.widgets.Text class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: pgcodekeeper   File: NewObjectWizard.java   Source Code and License Vote up 6 votes
@Override
public void createControl(Composite parent) {
    Composite area = new Composite(parent, SWT.NONE);
    area.setLayout(new GridLayout(2, false));
    area.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    new Label(area, SWT.NONE).setText(Messages.PgObject_project_name);
    viewerProject = new ComboViewer(area, SWT.READ_ONLY | SWT.DROP_DOWN);

    new Label(area, SWT.NONE).setText(Messages.PgObject_object_type);
    viewerType = new ComboViewer(area, SWT.READ_ONLY | SWT.DROP_DOWN);

    new Label(area, SWT.NONE).setText(Messages.PgObject_object_name);
    final Text txtName = new Text(area, SWT.BORDER);
    txtName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    txtName.addModifyListener(e -> {
        name = txtName.getText();
        getWizard().getContainer().updateButtons();
    });
    fillProjects();
    fillTypes();
    setControl(area);
}
 
Example 2
Project: vertigo-chroma-kspplugin   File: VertigoPropertyPage.java   Source Code and License Vote up 6 votes
private void addDtoParentsSection(Composite parent) {
	Composite composite = createDefaultComposite(parent);

	// Label for owner field
	Label ownerLabel = new Label(composite, SWT.NONE);
	ownerLabel.setText(DTO_PARENTS_TITLE);

	// Owner text field
	dtoParentsText = new Text(composite, SWT.MULTI | SWT.BORDER | SWT.WRAP | SWT.V_SCROLL);
	GridData gridData = new GridData(GridData.FILL_BOTH);
	gridData.heightHint = 100;
	dtoParentsText.setLayoutData(gridData);

	// Populate owner text field
	String text = PropertyUtils.getDtoParentClasses(getProject());
	if (text == null) {
		text = "";
	}
	dtoParentsText.setText(text);
}
 
Example 3
Project: pdi-git-plugin   File: UsernamePasswordDialog.java   Source Code and License Vote up 6 votes
@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 2;

  Label usernameLabel = new Label( comp, SWT.RIGHT );
  usernameLabel.setText( "Username: " );
  usernameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  usernameText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  Label passwordLabel = new Label( comp, SWT.RIGHT );
  passwordLabel.setText( "Password: " );
  passwordText = new Text( comp, SWT.SINGLE | SWT.BORDER | SWT.PASSWORD );
  passwordText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );

  return comp;
}
 
Example 4
Project: Hydrograph   File: AvailableFieldsComposite.java   Source Code and License Vote up 5 votes
private void createSearchTextBox(Composite headerComposite) {
	searchTextBox = new Text(headerComposite, SWT.BORDER);
	GridData gd_searchTextBox = new GridData(SWT.RIGHT, SWT.CENTER, true, true, 0, 0);
	gd_searchTextBox.widthHint = 191;
	searchTextBox.setLayoutData(gd_searchTextBox);
	searchTextBox.setForeground(CustomColorRegistry.INSTANCE.getColorFromRegistry( 128,128,128));
	searchTextBox.setText(Constants.DEFAULT_SEARCH_TEXT);
	addListnersToSearchTextBox();
	ExpressionEditorUtil.INSTANCE.addFocusListenerToSearchTextBox(searchTextBox);
}
 
Example 5
Project: gw4e.project   File: MavenTemplatePage.java   Source Code and License Vote up 5 votes
private void createGroupIdArea (Composite composite) {
	Label lblNewLabel = new Label(composite, SWT.NONE);
	lblNewLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 4, 1));
	lblNewLabel.setText(MessageUtil.getString("mvn_group_id"));
	textGrpID = new Text(composite, SWT.BORDER);
	textGrpID.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 8, 1));
	textGrpID.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent evt) {
			MavenTemplatePage.this.setGroupId(textGrpID.getText());
			validatePage();
		}
	});
	textGrpID.setText("com.company");
}
 
Example 6
Project: Hydrograph   File: DebugDataViewer.java   Source Code and License Vote up 5 votes
private void createPageNumberDisplay(Composite composite_3) {
	Text pageNumberDisplayTextBox = new Text(composite_3, SWT.BORDER | SWT.CENTER);
	pageNumberDisplayTextBox.setEnabled(false);
	pageNumberDisplayTextBox.setEditable(false);
	GridData gd_text = new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1);
	gd_text.widthHint = 178;
	pageNumberDisplayTextBox.setLayoutData(gd_text);

	windowControls.put(ControlConstants.PAGE_NUMBER_DISPLAY, pageNumberDisplayTextBox);
}
 
Example 7
Project: convertigo-eclipse   File: SapJcoConnectorComposite.java   Source Code and License Vote up 5 votes
@Override
protected void initialize() {
	GridData gridData = new org.eclipse.swt.layout.GridData();
	gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.grabExcessVerticalSpace = true;
	gridData.verticalAlignment = org.eclipse.swt.layout.GridData.FILL;
	httpData = new Text(this, SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
	httpData.setLayoutData(gridData);
	httpData.setText("");
	this.setLayout(new GridLayout());
	setSize(new Point(300, 200));
}
 
Example 8
Project: convertigo-eclipse   File: DatabaseObjectFindDialogComposite.java   Source Code and License Vote up 5 votes
protected void initialize() {
	GridData gridData3 = new GridData();
	gridData3.grabExcessHorizontalSpace = false;
	GridData gridData2 = new GridData();
	gridData2.horizontalAlignment = GridData.BEGINNING;
	gridData2.grabExcessHorizontalSpace = false;
	gridData2.horizontalSpan = 2;
	gridData2.verticalAlignment = GridData.CENTER;
	GridData gridData = new GridData();
	label1 = new Label(this, SWT.NONE);
	label1.setText("Object type");
	label1.setLayoutData(gridData);
	createCombo();
	label2 = new Label(this, SWT.NONE);
	label2.setText("Substring");
	text = new Text(this, SWT.BORDER);
	text.setLayoutData(gridData3);
	checkBox = new Button(this, SWT.CHECK);
	checkBox.setText("Match case");
	checkBox.setLayoutData(gridData2);
	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 2;
	this.setLayout(gridLayout);
	setSize(new Point(226, 125));
	
	combo.select(0);
	text.setText("");
}
 
Example 9
Project: eZooKeeper   File: GridTextInput.java   Source Code and License Vote up 5 votes
/**
 * Constructor.
 *
 * @param parent The parent {@link Composite}.
 * @param type The {@link Type}.
 * @param name The {@link GridTextInput} name.
 * @param labelText The {@link Label} text.
 * @param labelStyle The {@link Label} style.
 * @param labelLayoutData The {@link Label} {@link GridData layout data}.
 * @param textText The {@link Text} text.
 * @param textStyle The {@link Text} style.
 * @param textLayoutData The {@link Text} {@link GridData layout data}.
 */
public GridTextInput(Composite parent, Type type, String name, String labelText, int labelStyle,
        GridData labelLayoutData, String textText, int textStyle, GridData textLayoutData) {

    _Type = type;

    _DefaultTextValue = textText;

    if (_DefaultTextValue != null && _Type.isInteger()) {
        if (!isValidIntegerText(_DefaultTextValue)) {
            throw new IllegalArgumentException("Invalid integer value: " + _DefaultTextValue);
        }
    }

    _Name = name;

    if (labelText != null) {
        _Label = new Label(parent, labelStyle);
        _Label.setText(labelText);
        _Label.setLayoutData(labelLayoutData);
        _Label.pack();
    }

    _Text = new Text(parent, textStyle);
    if (textText != null) {
        _Text.setText(textText);
    }
    _Text.setLayoutData(textLayoutData);

    if (_Type.isInteger()) {
        _Text.setTextLimit(10);
    }

    _Text.setData(this);

}
 
Example 10
Project: neoscada   File: ConfigurationFormToolkit.java   Source Code and License Vote up 5 votes
public void createStandardText ( final Composite parent, final String attributeName, final int style, final String label, final String textMessage, final IObservableMap data, final Object valueType )
{
    final Label labelControl = this.toolkit.createLabel ( parent, label + ":" );

    final boolean multi = ( style & SWT.MULTI ) > 0;

    if ( multi )
    {
        labelControl.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, false ) );
    }

    final Text text = this.toolkit.createText ( parent, "", style );
    text.setMessage ( textMessage );
    final GridData gd = new GridData ( GridData.FILL, multi ? GridData.FILL : GridData.BEGINNING, true, true );
    gd.horizontalSpan = 2;
    text.setLayoutData ( gd );
    text.setToolTipText ( textMessage );

    final IObservableValue value = Observables.observeMapEntry ( data, attributeName, String.class );

    if ( valueType != null && valueType != String.class )
    {
        final WritableValue conversionValue = new WritableValue ( null, valueType );
        this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), conversionValue );
        this.dbc.bindValue ( conversionValue, value );
    }
    else
    {
        this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
    }
}
 
Example 11
Project: convertigo-eclipse   File: LearnScreenClassWizardComposite2.java   Source Code and License Vote up 5 votes
/**
 * This method initializes this
 * 
 */
private void initialize() {
       GridData gridData2 = new org.eclipse.swt.layout.GridData();
       gridData2.horizontalSpan = 3;
       label1 = new Label(this, SWT.NONE);
       label1.setText("Please choose what kind of screen class you would like to create\nbased one detected one");
       label1.setLayoutData(gridData2);
       GridData gridData1 = new org.eclipse.swt.layout.GridData();
       gridData1.grabExcessHorizontalSpace = true;
       gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
       GridData gridData = new org.eclipse.swt.layout.GridData();
       gridData.grabExcessHorizontalSpace = false;
       gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
       gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
       gridData.grabExcessVerticalSpace = false;
       createGroup();
       label = new Label(this, SWT.NONE);
       label.setText("Give a screen class name");
       label.setLayoutData(gridData);
       screenClassName = new Text(this, SWT.BORDER);
       screenClassName.setLayoutData(gridData1);
       screenClassName.addModifyListener(modifyListener);
       GridLayout gridLayout = new GridLayout();
       gridLayout.numColumns = 1;
       this.setLayout(gridLayout);
}
 
Example 12
Project: pdi-git-plugin   File: EditRepositoryDialog.java   Source Code and License Vote up 4 votes
@Override
protected Control createDialogArea( Composite parent ) {
  Composite comp = (Composite) super.createDialogArea( parent );

  GridLayout layout = (GridLayout) comp.getLayout();
  layout.numColumns = 3;

  Label nameLabel = new Label( comp, SWT.RIGHT );
  nameLabel.setText( "Name: " );
  nameLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  nameText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  nameText.setText( Const.NVL( repo.getName(), "" ) );
  nameText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );

  Label descLabel = new Label( comp, SWT.RIGHT );
  descLabel.setText( "Description: " );
  descLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  descText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  descText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  descText.setText( Const.NVL( repo.getDescription(), "" ) );

  Label directoryLabel = new Label( comp, SWT.RIGHT );
  directoryLabel.setText( "Directory: " );
  directoryLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  directoryText = new Text( comp, SWT.SINGLE | SWT.BORDER );
  directoryText.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false ) );
  directoryText.setText( Const.NVL( repo.getDirectory(), "" ) );

  Button directoryButton = new Button( comp, SWT.PUSH );
  directoryButton.setText( "Browse" );
  directoryButton.addSelectionListener( new SelectionAdapter() {
    @Override
    public void widgetSelected( SelectionEvent e ) {
      DirectoryDialog dialog = new DirectoryDialog( getShell(), SWT.OPEN );
      if ( dialog.open() != null ) {
        directoryText.setText( dialog.getFilterPath() );
      }
    }
  } );

  Label typeLabel = new Label( comp, SWT.RIGHT );
  typeLabel.setText( "Type: " );
  typeLabel.setLayoutData( new GridData( GridData.END, GridData.CENTER, false, false ) );
  typeCombo = new Combo( comp, SWT.READ_ONLY );
  typeCombo.setItems( IVCS.GIT, IVCS.SVN );
  if ( repo.getType() != null ) {
    if ( repo.getType().equals( IVCS.GIT ) ) {
      typeCombo.select( 0 );
    } else {
      typeCombo.select( 1 );
    }
  }
  typeCombo.setLayoutData( new GridData( GridData.FILL, GridData.CENTER, true, false, 2, 1 ) );
  return comp;
}
 
Example 13
Project: convertigo-eclipse   File: NewProjectWizardComposite11.java   Source Code and License Vote up 4 votes
protected void initialize() {
	Label urlDescription = new Label(this, SWT.NONE);
	urlDescription.setText("Please enter a valid target host url :");
	GridData data0 = new GridData ();
	data0.horizontalAlignment = GridData.FILL;
	data0.grabExcessHorizontalSpace = true;
	data0.horizontalSpan = 2;
	urlDescription.setLayoutData (data0);
	
	targetUrl = new Text(this, SWT.NONE);
	targetUrl.setText("http://www.convertigo.com");
	GridData data1 = new GridData ();
	data1.horizontalAlignment = GridData.FILL;
	data1.grabExcessHorizontalSpace = true;
	data1.horizontalSpan = 2;
	targetUrl.setLayoutData (data1);

	GridData gridData4 = new GridData();
	gridData4.verticalIndent = 5;
	gridData4.grabExcessHorizontalSpace = false;
	
	Label label6 = new Label(this, SWT.NONE);
	label6.setText("Trust all certificates");
	label6.setLayoutData(gridData4);
	
	GridData gridData5 = new GridData();
	gridData5.verticalIndent = 5;
	gridData5.horizontalIndent = 2;

	trustCertificates = new Button(this, SWT.CHECK);
	trustCertificates.setLayoutData(gridData5);

	if (modifyListener != null) {
		targetUrl.addModifyListener(modifyListener);
		trustCertificates.addSelectionListener(selectionListener);
	}
	
	GridLayout gridLayout = new GridLayout();
	gridLayout.numColumns = 2;
	this.setLayout(gridLayout);
	//setSize(new Point(402, 99));
}
 
Example 14
Project: n4js   File: InstallNpmDependencyDialog.java   Source Code and License Vote up 4 votes
private Text getSimpleTextArea(Composite parent) {
	final Text text = new Text(parent, BORDER);
	text.setLayoutData(new GridData(FILL, CENTER, true, false, 1, 1));
	return text;
}
 
Example 15
Project: convertigo-eclipse   File: ObjectInfoWizardPage.java   Source Code and License Vote up 4 votes
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Name:");

	beanName = new Text(container, SWT.BORDER | SWT.SINGLE);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	beanName.setLayoutData(gd);
	beanName.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			dialogChanged();
		}
	});
	
	if (parentObject instanceof CouchDbConnector || parentObject instanceof FullSyncConnector) {
		couchVariablesComposite = new CouchVariablesComposite(container, SWT.V_SCROLL);
		
		GridData couchVarData = new GridData(GridData.FILL_BOTH);
		couchVarData.horizontalSpan = 2;
		
		couchVariablesComposite.setLayoutData(couchVarData);
		
	} else {
		tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
		tree.setHeaderVisible(false);
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		gridData.verticalSpan = 20;
		gridData.horizontalSpan = 2;
		tree.setLayoutData(gridData);		
		tree.addListener(SWT.Selection, new Listener() {
			public void handleEvent(final Event event) {
				TreeItem item = (TreeItem) event.item;
				treeItemName = item.getText();
				String suffix = getBeanName().endsWith(ScHandlerStatement.EVENT_ENTRY_HANDLER) ? 
						ScHandlerStatement.EVENT_ENTRY_HANDLER:
							getBeanName().endsWith(ScHandlerStatement.EVENT_EXIT_HANDLER) ?
									ScHandlerStatement.EVENT_EXIT_HANDLER : "";
				setBeanName("on"+ treeItemName + suffix);
				dialogChanged();
			}
		});
		tree.setVisible(false);
	}
	
	initialize();
	dialogChanged();
	setControl(container);
}
 
Example 16
Project: com.onpositive.prefeditor   File: FolderSelectionDialog.java   Source Code and License Vote up 4 votes
protected Control createDialogArea(Composite parent) {
      // create composite
      Composite composite = (Composite) super.createDialogArea(parent);
      // create message
      if (message != null) {
          Label label = new Label(composite, SWT.WRAP);
          label.setText(message);
          GridData data = new GridData(GridData.GRAB_HORIZONTAL
                  | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
                  | GridData.VERTICAL_ALIGN_CENTER);
          data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
          label.setLayoutData(data);
          label.setFont(parent.getFont());
      }
      viewer = new ComboViewer(composite);
      viewer.setContentProvider(new ArrayContentProvider());
      viewer.addSelectionChangedListener(new ISelectionChangedListener() {
	
	@Override
	public void selectionChanged(
			SelectionChangedEvent event) {
		valueSelected(valueFromSelection(event.getSelection())); 
	}
});
      viewer.setLabelProvider(new LabelProvider() {
      	@Override
      	public String getText(Object element) {
      		if (element instanceof String) {
      			return PrefUIUtil.getFolderLabel((String) element, MAX_FOLDER_PATH_LEN);
      		}
      		return super.getText(element);
      	}
      });
      viewer.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      
      createLink(composite, "From folder", ()->addFolder());
      
      createLink(composite, "From workspace prefs", ()->addWorkspace());
      
      createLink(composite, "From installation", ()->addInstallation());
      
      createLink(composite, "From launch config", ()->addLaunchCfg());
      
      errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
      errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      errorMessageText.setBackground(errorMessageText.getDisplay()
              .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
      // Set the error message text
      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
      setErrorMessage(errorMessage);

      applyDialogFont(composite);
      return composite;
  }
 
Example 17
Project: AppleCommander   File: ExportFileDestinationPane.java   Source Code and License Vote up 4 votes
/**
 * Create and display the wizard pane.
 * @see com.webcodepro.applecommander.ui.swt.wizard.WizardPane#open()
 */
public void open() {
	control = new Composite(parent, SWT.NULL);
	control.setLayoutData(layoutData);
	wizard.enableNextButton(false);
	wizard.enableFinishButton(true);
	RowLayout layout = new RowLayout(SWT.VERTICAL);
	layout.justify = true;
	layout.marginBottom = 5;
	layout.marginLeft = 5;
	layout.marginRight = 5;
	layout.marginTop = 5;
	layout.spacing = 3;
	control.setLayout(layout);
	Label label = new Label(control, SWT.WRAP);
	label.setText(textBundle.get("ExportFilePrompt")); //$NON-NLS-1$

	directoryText = new Text(control, SWT.WRAP | SWT.BORDER);
	if (wizard.getDirectory() != null) directoryText.setText(wizard.getDirectory());
	directoryText.setLayoutData(new RowData(parent.getSize().x - 30, -1));
	directoryText.setBackground(new Color(control.getDisplay(), 255,255,255));
	directoryText.setFocus();
	directoryText.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent event) {
			Text text = (Text) event.getSource();
			getWizard().setDirectory(text.getText());
		}
	});
	
	Button button = new Button(control, SWT.PUSH);
	button.setText(textBundle.get("BrowseButton")); //$NON-NLS-1$
	button.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent e) {
			DirectoryDialog directoryDialog = new DirectoryDialog(getShell());
			directoryDialog.setFilterPath(getDirectoryText().getText());
			directoryDialog.setMessage(
				UiBundle.getInstance().get("ExportFileDirectoryPrompt")); //$NON-NLS-1$
			String directory = directoryDialog.open();
			if (directory != null) {
				getDirectoryText().setText(directory);
			}
		}
	});
}
 
Example 18
Project: gemoc-studio-modeldebugging   File: LaunchConfigurationMainTab.java   Source Code and License Vote up 4 votes
private Composite createAnimationLayout(Composite parent, Font font) {
	createTextLabelLayout(parent, "Animator");

	_siriusRepresentationLocationText = new Text(parent, SWT.SINGLE
			| SWT.BORDER);
	_siriusRepresentationLocationText.setLayoutData(createStandardLayout());
	_siriusRepresentationLocationText.setFont(font);
	_siriusRepresentationLocationText
			.addModifyListener(fBasicModifyListener);
	Button siriusRepresentationLocationButton = createPushButton(parent,
			"Browse", null);
	siriusRepresentationLocationButton
			.addSelectionListener(new SelectionAdapter() {
				public void widgetSelected(SelectionEvent evt) {
					// handleModelLocationButtonSelected();
					// TODO launch the appropriate selector

					SelectAIRDIFileDialog dialog = new SelectAIRDIFileDialog();
					if (dialog.open() == Dialog.OK) {
						String modelPath = ((IResource) dialog.getResult()[0])
								.getFullPath().toPortableString();
						_siriusRepresentationLocationText
								.setText(modelPath);
						updateLaunchConfigurationDialog();
					}
				}
			});

	createTextLabelLayout(parent, "Delay");
	_delayText = new Text(parent, SWT.SINGLE | SWT.BORDER);
	_delayText.setLayoutData(createStandardLayout());
	_delayText.addModifyListener(new ModifyListener() {

		@Override
		public void modifyText(ModifyEvent e) {
			updateLaunchConfigurationDialog();
		}
	});
	createTextLabelLayout(parent, "(in milliseconds)");

	new Label(parent, SWT.NONE).setText("");
	_animationFirstBreak = new Button(parent, SWT.CHECK);
	_animationFirstBreak.setText("Break at start");
	_animationFirstBreak.addSelectionListener(new SelectionAdapter() {

		@Override
		public void widgetSelected(SelectionEvent event) {
			updateLaunchConfigurationDialog();
		}
	}

	);

	return parent;
}
 
Example 19
Project: Hydrograph   File: ExpresssionOperationImportExportComposite.java   Source Code and License Vote up 4 votes
public ExpresssionOperationImportExportComposite(Composite parent, int style,ImportExportType type, ExternalWidgetData externalWidgetData) {
	super(parent, style);
	this.externalWidgetData = externalWidgetData;
	setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	setLayout(new GridLayout(1, false));
	Composite exprOperImportExportComposite = new Composite(this, SWT.NONE);
	exprOperImportExportComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	exprOperImportExportComposite.setLayout(new GridLayout(2, false));
	
	labelExperssionType = new Label(exprOperImportExportComposite, SWT.NONE);
	labelExperssionType.setText( type.getValue() +" Type");
	
	radioButtonCompsite = new Composite(exprOperImportExportComposite, SWT.NONE);
	radioButtonCompsite.setLayout(new GridLayout(2, false));
	radioButtonCompsite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	btnRadioInternal = new Button(radioButtonCompsite, SWT.RADIO);
	btnRadioInternal.setText("Internal "+type.getValue());
	
	btnRadioExternal = new Button(radioButtonCompsite, SWT.RADIO);
	btnRadioExternal.setText("External "+type.getValue());
	
	lblExternal = new Label(exprOperImportExportComposite, SWT.NONE);
	lblExternal.setText("External Path");
	
	Composite browseButtonComposite = new Composite(exprOperImportExportComposite, SWT.NONE);
	browseButtonComposite.setLayout(new GridLayout(2, false));
	browseButtonComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	txtExternalPath = new Text(browseButtonComposite, SWT.BORDER);
	txtExternalPath.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	decorator = WidgetUtility.addDecorator(txtExternalPath, "Field should not be blank.");
	decorator.hide();
	decorator.setMarginWidth(3);
	btnBrowse = new Button(browseButtonComposite, SWT.NONE);
    GridData gd_btnNewButton = new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1);
	gd_btnNewButton.heightHint = 25;
	
	if(OSValidator.isMac()){
		gd_btnNewButton.widthHint = 43;
		gd_btnNewButton.horizontalIndent=-5;
		
	}else{
		gd_btnNewButton.widthHint = 30;
	}
	btnBrowse.setLayoutData(gd_btnNewButton);
	btnBrowse.setText("...");
	new Label(exprOperImportExportComposite, SWT.NONE);
	
	Composite importExportButtonComposite = new Composite(exprOperImportExportComposite, SWT.NONE);
	importExportButtonComposite.setLayout(new GridLayout(2, false));
	importExportButtonComposite.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	
	btnImport = new Button(importExportButtonComposite, SWT.NONE);
	btnImport.setText("Import "+type.getValue());
	btnExport = new Button(importExportButtonComposite, SWT.NONE);
	btnExport.setText("Export "+type.getValue());
	btnExport.setEnabled(false);
	btnImport.setEnabled(false);
	addListners();
	updateWidgetValueWithPreviousChoices();
	addSelectinListnerToExportImport();
	
	addModifyListnerToExternalPathTextBox(externalWidgetData);
}
 
Example 20
Project: convertigo-eclipse   File: ComponentInfoWizardPage.java   Source Code and License Vote up 4 votes
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Name:");

	beanName = new Text(container, SWT.BORDER | SWT.SINGLE);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	beanName.setLayoutData(gd);
	beanName.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			dialogChanged();
		}
	});
	
	if (parentObject instanceof CouchDbConnector || parentObject instanceof FullSyncConnector) {
		couchVariablesComposite = new CouchVariablesComposite(container, SWT.V_SCROLL);
		
		GridData couchVarData = new GridData(GridData.FILL_BOTH);
		couchVarData.horizontalSpan = 2;
		
		couchVariablesComposite.setLayoutData(couchVarData);
		
	} else {
		tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
		tree.setHeaderVisible(false);
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		gridData.verticalSpan = 20;
		gridData.horizontalSpan = 2;
		tree.setLayoutData(gridData);		
		tree.addListener(SWT.Selection, new Listener() {
			public void handleEvent(final Event event) {
				TreeItem item = (TreeItem) event.item;
				treeItemName = item.getText();
				String suffix = getBeanName().endsWith(ScHandlerStatement.EVENT_ENTRY_HANDLER) ? 
						ScHandlerStatement.EVENT_ENTRY_HANDLER:
							getBeanName().endsWith(ScHandlerStatement.EVENT_EXIT_HANDLER) ?
									ScHandlerStatement.EVENT_EXIT_HANDLER : "";
				setBeanName("on"+ treeItemName + suffix);
				dialogChanged();
			}
		});
		tree.setVisible(false);
	}
	
	initialize();
	dialogChanged();
	setControl(container);
}