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

The following examples show how to use org.eclipse.swt.widgets.Group#setLayoutData() . 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: NetworkPreferencePage.java    From saros with GNU General Public License v2.0 6 votes vote down vote up
private Group createStunServerGroup(Composite parent) {
  Group group = new Group(parent, SWT.NONE);

  group.setText(Messages.NetworkPreferencePage_stun_server);

  GridLayout gridLayout = new GridLayout();
  gridLayout.numColumns = 2;

  group.setLayout(gridLayout);
  group.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  Label ipAddressLabel = new Label(group, SWT.CENTER);
  ipAddressLabel.setText(Messages.NetworkPreferencePage_adress);
  ipAddressLabel.setToolTipText(Messages.NetworkPreferencePage_adress_tooltip);

  stunIPAddressText = new Text(group, SWT.SINGLE | SWT.BORDER);
  stunIPAddressText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
  Label portLabel = new Label(group, SWT.CENTER);
  portLabel.setText(Messages.NetworkPreferencePage_port);
  portLabel.setToolTipText(Messages.NetworkPreferencePage_port_tooltip);

  stunPortText = new Text(group, SWT.SINGLE | SWT.BORDER);
  stunPortText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

  return group;
}
 
Example 2
Source File: MenuDataDialog.java    From EasyShell with Eclipse Public License 2.0 6 votes vote down vote up
public Group createGroupCommand(Composite parent) {
    Font font = parent.getFont();
    Group pageGroupCommand = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroupCommand.setText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.command"));
    pageGroupCommand.setToolTipText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.tooltip.command"));
    GridLayout layoutCommand = new GridLayout();
    layoutCommand.numColumns = 3;
    layoutCommand.makeColumnsEqualWidth = false;
    layoutCommand.marginWidth = 5;
    layoutCommand.marginHeight = 4;
    pageGroupCommand.setLayout(layoutCommand);
    GridData gridDataCommand = new GridData(GridData.FILL_HORIZONTAL);
    pageGroupCommand.setLayoutData(gridDataCommand);
    pageGroupCommand.setFont(font);
    return pageGroupCommand;
}
 
Example 3
Source File: DefaultedPipelineOptionsComponent.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
@VisibleForTesting
DefaultedPipelineOptionsComponent(Composite parent, Object layoutData,
    MessageTarget messageTarget, DataflowPreferences preferences,
    RunOptionsDefaultsComponent defaultOptions) {
  this.preferences = preferences;
  customValues = new HashMap<>();

  defaultsGroup = new Group(parent, SWT.NULL);
  int numColumns = 3;
  defaultsGroup.setLayout(new GridLayout(numColumns, false));
  defaultsGroup.setLayoutData(layoutData);

  useDefaultsButton = new Button(defaultsGroup, SWT.CHECK);
  useDefaultsButton.setText("Use &default Dataflow options");
  useDefaultsButton.setSelection(true);

  useDefaultsButton.addSelectionListener(new SetInputsEnabledOppositeButtonSelectionListener());
  useDefaultsButton.addSelectionListener(new SetInputValuesToDefaultOrCustomSelectionListener());

  useDefaultsButton.setLayoutData(
      new GridData(SWT.BEGINNING, SWT.CENTER, true, false, numColumns, 1));

  this.defaultOptions = defaultOptions == null
      ? new RunOptionsDefaultsComponent(defaultsGroup, numColumns, messageTarget, preferences)
      : defaultOptions;
}
 
Example 4
Source File: FrameMakerPreferencePage.java    From translationstudio8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite tparent = new Composite(parent, SWT.NONE);
	tparent.setLayout(new GridLayout());
	tparent.setLayoutData(new GridData(GridData.FILL_BOTH));

	Group groupCommon = new Group(tparent, SWT.NONE);
	groupCommon.setLayout(new GridLayout());
	groupCommon.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	groupCommon.setText(Messages.getString("preference.FrameMakerPreferencePage.groupCommon"));

	HsImageLabel imageLabel = new HsImageLabel(
			Messages.getString("preference.FrameMakerPreferencePage.imageLabel"),
			Activator.getImageDescriptor(Constants.PREFERENCE_FRAMEMAKER_32));
	Composite cmpCommon = imageLabel.createControl(groupCommon);
	cmpCommon.setLayout(new GridLayout());
	cmpCommon.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	btnMaster = new Button(cmpCommon, SWT.CHECK);
	btnMaster.setText(Messages.getString("preference.FrameMakerPreferencePage.btnMaster"));
	GridDataFactory.fillDefaults().applyTo(btnMaster);

	imageLabel.computeSize();
	btnMaster.setSelection(preferenceStore.getBoolean(Constants.FRAMEMAKER_FILTER));
	return parent;
}
 
Example 5
Source File: IndexDialog.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
/**
 * This method initializes group
 * 
 */
private void createGroup(Composite composite) {
	GridLayout gridLayout4 = new GridLayout();
	gridLayout4.verticalSpacing = 5;
	gridLayout4.marginHeight = 10;
	GridData gridData6 = new GridData();
	gridData6.widthHint = 150;
	gridData6.heightHint = 150;
	GridData gridData3 = new GridData();
	gridData3.verticalSpan = 2;
	gridData3.horizontalAlignment = GridData.BEGINNING;

	Group group = new Group(composite, SWT.NONE);
	group.setLayoutData(gridData3);
	group.setLayout(gridLayout4);
	group
			.setText(ResourceString
					.getResourceString("label.all.column.list"));
	allColumnList = new org.eclipse.swt.widgets.List(group, SWT.BORDER
			| SWT.V_SCROLL);
	allColumnList.setLayoutData(gridData6);
}
 
Example 6
Source File: DetailComponentImpl.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
private void createGroupGridEntry ( final Map<String, String> properties, final Composite childParent, final GroupGridEntry groupEntry )
{
    final VisibilityProvider provider = this.visibleFactory.createProvider ( groupEntry.getVisibility () );

    final ComponentVisibility visibility = new ComponentVisibility ( provider, new SubTrackingVisibleComponent () {

        @Override
        public void create ()
        {
            final Group groupWidget = new Group ( childParent, SWT.NONE );

            groupWidget.setLayout ( new GridLayout ( 1, false ) );
            groupWidget.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );

            final String label = groupEntry.getLabel ();
            if ( label != null )
            {
                groupWidget.setText ( label );
            }

            for ( final Component child : groupEntry.getComponents () )
            {
                final DetailComponentImpl comp = new DetailComponentImpl ( child, DetailComponentImpl.this.viewContext );

                final Composite wrapper = new Composite ( groupWidget, SWT.NONE );
                wrapper.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );
                wrapper.setLayout ( new FillLayout () );

                comp.init ( DetailComponentImpl.this.visibleFactory, wrapper, properties );

                trackSub ( comp );
            }

            trackControl ( groupWidget );
        }
    } );

    addComponent ( visibility );
}
 
Example 7
Source File: TypeScriptMainPreferencePage.java    From typescript.java with MIT License 5 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite comp = new Composite(parent, SWT.NONE);
	comp.setFont(parent.getFont());
	comp.setLayout(new GridLayout());
	comp.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	String[][] uses = new String[3][2];
	uses[0][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_Never;
	uses[0][1] = UseSalsa.Never.name();
	uses[1][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_EveryTime;
	uses[1][1] = UseSalsa.EveryTime.name();
	uses[2][0] = TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa_WhenNoJSDTNature;
	uses[2][1] = UseSalsa.WhenNoJSDTNature.name();

	ComboFieldEditor ternServerEditor = new ComboFieldEditor(
			TypeScriptCorePreferenceConstants.USE_SALSA_AS_JS_INFERENCE,
			TypeScriptUIMessages.TypeScriptMainPreferencePage_useSalsa, uses, comp);
	initEditor(ternServerEditor, getPreferenceStore());

	Group refactoringGroup = new Group(comp, SWT.NONE);
	refactoringGroup.setLayout(new GridLayout());
	GridData data = new GridData(GridData.FILL_HORIZONTAL);
	data.horizontalSpan = 2;
	refactoringGroup.setLayoutData(data);
	refactoringGroup.setText(TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_title);

	BooleanFieldEditor refactoringAutoSave = new BooleanFieldEditor(
			TypeScriptCorePreferenceConstants.REFACTOR_SAVE_ALL_EDITORS,
			TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_auto_save, refactoringGroup);
	initEditor(refactoringAutoSave, getPreferenceStore());

	BooleanFieldEditor refactoringLightweight = new BooleanFieldEditor(
			TypeScriptCorePreferenceConstants.REFACTOR_LIGHTWEIGHT,
			TypeScriptUIMessages.TypeScriptMainPreferencePage_refactoring_lightweight, refactoringGroup);
	initEditor(refactoringLightweight, getPreferenceStore());
	initGroup(refactoringGroup);

	return comp;
}
 
Example 8
Source File: TextMateConfigurationBlock.java    From typescript.java with MIT License 5 votes vote down vote up
/**
 * Create editor options.
 * 
 * @param parent
 */
private void createTextMateOptions(Composite parent) {

	Group group = new Group(parent, SWT.NONE);
	group.setText(TypeScriptUIMessages.TextMateConfigurationBlock_textmate_group_label);

	GridLayout layout = new GridLayout();
	layout.numColumns = 3;
	group.setLayout(layout);
	group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	// Use TextMate for syntax coloring
	addCheckBox(group, TypeScriptUIMessages.TextMateConfigurationBlock_textmate_SyntaxColoring,
			PREF_USE_TEXMATE_FOR_SYNTAX_COLORING, new String[] { "true", "false" }, 0);
}
 
Example 9
Source File: InstallNpmDependencyDialog.java    From n4js with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(Composite parent) {
	final Group customDialogArea = new Group(parent, SHADOW_ETCHED_IN);
	customDialogArea.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).equalWidth(false).create());
	customDialogArea.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, TOP).create());

	createNameArea(customDialogArea, PACKAGE_NAME, this::handlePackageNameInput);
	createVersionArea(customDialogArea, VERSION_OPTIONAL, this::handleVersionInput);

	return customDialogArea;
}
 
Example 10
Source File: SearchDialog.java    From erflute with Apache License 2.0 5 votes vote down vote up
private void createWordCheckboxGroup(Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalSpan = 2;
    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 4;

    final Group group = new Group(parent, SWT.NONE);
    group.setLayout(gridLayout);
    group.setLayoutData(gridData);

    physicalWordNameCheckBox = new Button(group, SWT.CHECK);
    physicalWordNameCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.28"));

    logicalWordNameCheckBox = new Button(group, SWT.CHECK);
    logicalWordNameCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.29"));

    wordTypeCheckBox = new Button(group, SWT.CHECK);
    wordTypeCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.30"));

    wordLengthCheckBox = new Button(group, SWT.CHECK);
    wordLengthCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.31"));

    wordDecimalCheckBox = new Button(group, SWT.CHECK);
    wordDecimalCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.32"));

    wordDescriptionCheckBox = new Button(group, SWT.CHECK);
    wordDescriptionCheckBox.setText(DisplayMessages.getMessage("search.result.row.name.33"));
}
 
Example 11
Source File: SplitterPropertiesEditionPartImpl.java    From eip-designer with Apache License 2.0 5 votes vote down vote up
/**
 * 
 */
protected Composite createPropertiesGroup(Composite parent) {
	Group propertiesGroup = new Group(parent, SWT.NONE);
	propertiesGroup.setText(EipMessages.SplitterPropertiesEditionPart_PropertiesGroupLabel);
	GridData propertiesGroupData = new GridData(GridData.FILL_HORIZONTAL);
	propertiesGroupData.horizontalSpan = 3;
	propertiesGroup.setLayoutData(propertiesGroupData);
	GridLayout propertiesGroupLayout = new GridLayout();
	propertiesGroupLayout.numColumns = 3;
	propertiesGroup.setLayout(propertiesGroupLayout);
	return propertiesGroup;
}
 
Example 12
Source File: InputParameterDialog.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private Composite createParamGroupSection(
		AbstractParameterGroup paramGroup, Composite parent )
{
	Group group = new Group( parent, SWT.NONE );
	group.setText( paramGroup.getHandle( ).getDisplayLabel( ) );
	group.setLayoutData( new GridData( GridData.FILL_HORIZONTAL
			| GridData.GRAB_HORIZONTAL ) );
	group.setLayout( new GridLayout( ) );
	return group;
}
 
Example 13
Source File: SWTAtdl4jInputAndFilterDataPanel.java    From atdl4j with MIT License 5 votes vote down vote up
protected Composite buildAtdl4jOptionsSettingsPanel( Composite aParent )
{
	Group tempAtdl4jOptionsSettingsGroup = new Group( aParent, SWT.NONE );
	tempAtdl4jOptionsSettingsGroup.setText( "Atdl4j Settings" );
	GridLayout tempAtdl4jOptionsSettingsGroupLayout = new GridLayout( 1, true );
	tempAtdl4jOptionsSettingsGroup.setLayout(tempAtdl4jOptionsSettingsGroupLayout);
	tempAtdl4jOptionsSettingsGroup.setLayoutData(new GridData(SWT.TOP, SWT.FILL, false, false));
	
	checkboxAtd4ljShowStrategyDescription = new Button( tempAtdl4jOptionsSettingsGroup, SWT.CHECK );
	checkboxAtd4ljShowStrategyDescription.setText( "Show Strategy Description" );
	checkboxAtd4ljShowStrategyDescription.setToolTipText( "When checked, Strategy Description panel will be shown when Strategy's Description has been specified." );
	checkboxAtd4ljShowStrategyDescription.setSelection( Atdl4jConfig.getConfig().isShowStrategyDescription() );
	
	checkboxAtd4ljShowFileSelectionSection = new Button( tempAtdl4jOptionsSettingsGroup, SWT.CHECK );
	checkboxAtd4ljShowFileSelectionSection.setText( "Show File Selection" );
	checkboxAtd4ljShowFileSelectionSection.setToolTipText( "When checked, File Selection panel will be shown." );
	checkboxAtd4ljShowFileSelectionSection.setSelection( Atdl4jConfig.getConfig().isShowFileSelectionSection() );
	
	checkboxAtd4ljShowValidateOutputSection = new Button( tempAtdl4jOptionsSettingsGroup, SWT.CHECK );
	checkboxAtd4ljShowValidateOutputSection.setText( "Show Validation Section" );
	checkboxAtd4ljShowValidateOutputSection.setToolTipText( "When checked, Validation panel will be shown providing \"Validate\" button and output text field." );
	checkboxAtd4ljShowValidateOutputSection.setSelection( Atdl4jConfig.getConfig().isShowValidateOutputSection() );
	
	checkboxAtd4ljShowTesterPanelOkCancelButtonSection = new Button( tempAtdl4jOptionsSettingsGroup, SWT.CHECK );
	checkboxAtd4ljShowTesterPanelOkCancelButtonSection.setText( "Show OK/Close" );
	checkboxAtd4ljShowTesterPanelOkCancelButtonSection.setToolTipText( "When checked, \"OK\" and \"Close\" buttons will be displayed and available." );
	checkboxAtd4ljShowTesterPanelOkCancelButtonSection.setSelection( Atdl4jConfig.getConfig().isShowTesterPanelOkCancelButtonSection() );
	
	checkboxAtd4ljAccommodateMixOfStrategyPanelsAndControls = new Button( tempAtdl4jOptionsSettingsGroup, SWT.CHECK );
	checkboxAtd4ljAccommodateMixOfStrategyPanelsAndControls.setText( "Accommodate SP/Controls Mix" );
	checkboxAtd4ljAccommodateMixOfStrategyPanelsAndControls.setToolTipText( "Accommodates StrategyPanel containing a mix of StrategyPanel and Controls.\nFIXatdl 1.1 spec recommends against vs. prohibits.  Mixed list may not be displayed 'in sequence' of file." );
	checkboxAtd4ljAccommodateMixOfStrategyPanelsAndControls.setSelection( getAtdl4jOptions().isAccommodateMixOfStrategyPanelsAndControls() );
	
	return tempAtdl4jOptionsSettingsGroup;
}
 
Example 14
Source File: SearchDialog.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
private void createGroupCheckboxGroup(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalSpan = NUM_COLUMNS - 1;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 4;

    final Group group = new Group(parent, SWT.NONE);
    group.setLayoutData(gridData);
    group.setLayout(gridLayout);

    groupNameCheckBox = new Button(group, SWT.CHECK);
    groupNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.20"));

    new Label(group, SWT.NONE);
    new Label(group, SWT.NONE);
    new Label(group, SWT.NONE);

    physicalGroupColumnNameCheckBox = new Button(group, SWT.CHECK);
    physicalGroupColumnNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.13"));

    logicalGroupColumnNameCheckBox = new Button(group, SWT.CHECK);
    logicalGroupColumnNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.14"));

    groupColumnTypeCheckBox = new Button(group, SWT.CHECK);
    groupColumnTypeCheckBox.setText(ResourceString.getResourceString("search.result.row.name.15"));

    groupColumnLengthCheckBox = new Button(group, SWT.CHECK);
    groupColumnLengthCheckBox.setText(ResourceString.getResourceString("search.result.row.name.16"));

    groupColumnDecimalCheckBox = new Button(group, SWT.CHECK);
    groupColumnDecimalCheckBox.setText(ResourceString.getResourceString("search.result.row.name.17"));

    groupColumnDefaultValueCheckBox = new Button(group, SWT.CHECK);
    groupColumnDefaultValueCheckBox.setText(ResourceString.getResourceString("search.result.row.name.18"));

    groupColumnDescriptionCheckBox = new Button(group, SWT.CHECK);
    groupColumnDescriptionCheckBox.setText(ResourceString.getResourceString("search.result.row.name.19"));
}
 
Example 15
Source File: UpdateTMWizardPage.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
public void createContent(Composite parent) {
	TableViewer tableViewer = new TableViewer(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION);
	final Table table = tableViewer.getTable();
	GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
	tableData.heightHint = 160;
	table.setLayoutData(tableData);
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	
	TableColumn columnNumber = new TableColumn(table, SWT.LEFT);
	columnNumber.setText(Messages.getString("wizard.UpdateTMWizardPage.columnNumber"));
	columnNumber.setWidth(50);
	
	TableColumn columnPath = new TableColumn(table, SWT.LEFT);
	columnPath.setText(Messages.getString("wizard.UpdateTMWizardPage.columnPath"));
	columnPath.setWidth(400);
	
	tableViewer.setLabelProvider(new TableViewerLabelProvider());
	tableViewer.setContentProvider(new ArrayContentProvider());
	tableViewer.setInput(getTableInfo());
	
	Group groupStatus = new Group(parent, SWT.None);
	groupStatus.setLayout(new GridLayout());
	groupStatus.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	groupStatus.setText(Messages.getString("dialog.UpdateTMDialog.lbl"));
	btnDraft = new Button(groupStatus, SWT.CHECK);
	btnDraft.setText(Messages.getString("dialog.UpdateTMDialog.btnDraft"));

	btnTranslated = new Button(groupStatus, SWT.CHECK);
	btnTranslated.setText(Messages.getString("dialog.UpdateTMDialog.btnTranslated"));
	btnTranslated.setSelection(true);

	btnApproved = new Button(groupStatus, SWT.CHECK);
	btnApproved.setText(Messages.getString("dialog.UpdateTMDialog.btnApproved"));
	btnApproved.setSelection(true);

	btnSignedOff = new Button(groupStatus, SWT.CHECK);
	btnSignedOff.setText(Messages.getString("dialog.UpdateTMDialog.btnSignedOff"));
	btnSignedOff.setSelection(true);
	
	btnLocked = new Button(groupStatus, SWT.CHECK);
	btnLocked.setText(Messages.getString("dialog.UpdateTMWizardPage.btnLocked"));
}
 
Example 16
Source File: TranslationPreferencePage.java    From tmxeditor8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	Composite tparent = new Composite(parent, SWT.NONE);
	tparent.setLayout(new GridLayout());
	tparent.setLayoutData(new GridData(GridData.FILL_BOTH));

	Group group = new Group(tparent, SWT.NONE);
	group.setLayout(new GridLayout());
	group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	group.setText(Messages.getString("translation.TranslationPreferencePage.group"));

	HsImageLabel imageLabel = new HsImageLabel(
			Messages.getString("translation.TranslationPreferencePage.imageLabel"),
			Activator.getImageDescriptor("images/preference/translate/trans_32.png"));

	Composite comp = imageLabel.createControl(group);

	btnAutoAdaptSpacePosition = new Button(comp, SWT.CHECK);
	btnAutoAdaptSpacePosition.setText(Messages
			.getString("translation.TranslationPreferencePage.btnAutoAdaptSpacePosition"));
	btnAutoAdaptSpacePosition.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	btnAutoApplyTmMatch = new Button(comp, SWT.CHECK);
	btnAutoApplyTmMatch.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	btnAutoApplyTmMatch.setText(Messages.getString("translation.TranslationPreferencePage.btnAutoApplyTmMatch"));

	btnCopyToTarget = new Button(comp, SWT.CHECK);
	btnCopyToTarget.setText(Messages.getString("translation.TranslationPreferencePage.btnCopyToTarget"));
	btnCopyToTarget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	// btnSkipNotTranslateText = new Button(comp, SWT.CHECK);
	// btnSkipNotTranslateText.setText("翻译时跳过锁定文本段");
	// btnSkipNotTranslateText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	btnAutoQuickTranslation = new Button(comp, SWT.CHECK);
	btnAutoQuickTranslation.setText(Messages
			.getString("translation.TranslationPreferencePage.btnAutoQuickTranslation"));
	btnAutoQuickTranslation.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	imageLabel.computeSize();

	Group openOfficeGroup = new Group(tparent, SWT.NONE);
	openOfficeGroup.setLayout(new GridLayout());
	openOfficeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	openOfficeGroup.setText(Messages.getString("translation.TranslationPreferencePage.openOfficeGroup"));

	HsImageLabel imageLabel2 = new HsImageLabel(
			Messages.getString("translation.TranslationPreferencePage.imageLabel2"),
			Activator.getImageDescriptor("images/preference/translate/trans_office_32.png"));

	Composite composite = imageLabel2.createControl(openOfficeGroup);
	GridLayout gd = new GridLayout(3, false);
	gd.marginLeft = 0;
	gd.marginTop = 0;
	composite.setLayout(gd);

	new Label(composite, SWT.NONE).setText(Messages.getString("translation.TranslationPreferencePage.lblOO"));
	txtPath = new Text(composite, SWT.BORDER | SWT.READ_ONLY);
	txtPath.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	btnBrowse = new Button(composite, SWT.NONE);
	btnBrowse.setText(Messages.getString("translation.TranslationPreferencePage.btnBrowse"));

	imageLabel2.computeSize();

	setValues(false);
	initListener();
	return tparent;
}
 
Example 17
Source File: TopicSelection.java    From hop with Apache License 2.0 4 votes vote down vote up
private void layoutUI() {
  FormLayout topicSelectionLayout = new FormLayout();
  this.setLayout( topicSelectionLayout );

  wTopicGroup = new Group( this, SWT.SHADOW_ETCHED_IN );
  props.setLook( wTopicGroup );
  wTopicGroup.setText( topicGroupLabel );

  FormLayout topicGroupLayout = new FormLayout();
  topicGroupLayout.marginHeight = 15;
  topicGroupLayout.marginWidth = 15;
  wTopicGroup.setLayout( topicGroupLayout );

  FormData fdTopicGroup = new FormData();
  fdTopicGroup.left = new FormAttachment( 0, 0 );
  fdTopicGroup.top = new FormAttachment( 0, 10 );
  fdTopicGroup.right = new FormAttachment( 100, 0 );
  fdTopicGroup.bottom = new FormAttachment( 100, 0 );
  wTopicGroup.setLayoutData( fdTopicGroup );

  wTopicFromText = new Button( wTopicGroup, SWT.RADIO );
  wTopicFromField = new Button( wTopicGroup, SWT.RADIO );
  props.setLook( wTopicFromText );
  props.setLook( wTopicFromField );

  SelectionAdapter selectionListener = new SelectionAdapter() {
    @Override
    public void widgetSelected( SelectionEvent selectionEvent ) {
      super.widgetSelected( selectionEvent );
      setTopicWidgetVisibility( wTopicFromField );
    }
  };

  wTopicFromField.addSelectionListener( selectionListener );
  wTopicFromText.addSelectionListener( selectionListener );

  wTopicFromField.setSelection( topicInField );
  wTopicFromText.setSelection( !topicInField );

  wTopicFromText.setText( textTopicRadioLabel );
  wTopicFromField.setText( fieldTopicRadioLabel );

  FormData specifyTopicLayout = new FormData();
  specifyTopicLayout.left = new FormAttachment( 0, 0 );
  specifyTopicLayout.top = new FormAttachment( 0, 0 );
  wTopicFromText.setLayoutData( specifyTopicLayout );

  FormData fdTopicComesFromField = new FormData();
  fdTopicComesFromField.left = new FormAttachment( 0, 0 );
  fdTopicComesFromField.top = new FormAttachment( wTopicFromText, 5 );

  wTopicFromField.setLayoutData( fdTopicComesFromField );
  wTopicFromField.addSelectionListener( selectionListener );
  wTopicFromText.addSelectionListener( selectionListener );

  Label separator = new Label( wTopicGroup, SWT.SEPARATOR | SWT.VERTICAL );
  FormData fdSeparator = new FormData();
  fdSeparator.top = new FormAttachment( 0, 0 );
  fdSeparator.left = new FormAttachment( wTopicFromField, 15 );
  fdSeparator.bottom = new FormAttachment( 100, 0 );
  separator.setLayoutData( fdSeparator );

  FormData fdTopicEntry = new FormData();
  fdTopicEntry.top = new FormAttachment( 0, 0 );
  fdTopicEntry.left = new FormAttachment( separator, 15 );
  fdTopicEntry.right = new FormAttachment( 100, 0 );

  wlTopic = new Label( wTopicGroup, SWT.LEFT );
  wlTopic.setLayoutData( fdTopicEntry );
  props.setLook( wlTopic );

  FormData formData = new FormData();
  formData.top = new FormAttachment( wlTopic, 5 );
  formData.left = new FormAttachment( separator, 15 );
  formData.right = new FormAttachment( 100, 0 );

  wTopicText = new TextVar( pipelineMeta, wTopicGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wTopicField = createFieldDropDown( wTopicGroup, props, transformMeta, formData );
  wTopicText.setLayoutData( formData );
  wTopicField.setLayoutData( formData );

  setTopicWidgetVisibility( wTopicFromField );

  wTopicText.addModifyListener( lsMod );
  wTopicField.addModifyListener( lsMod );
}
 
Example 18
Source File: TmMatchEditDialog.java    From translationstudio8 with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite container = (Composite) super.createDialogArea(parent);
	container.setLayout(new GridLayout(1, false));

	Group srcGroup = new Group(container, SWT.NONE);
	srcGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	srcGroup.setLayout(new GridLayout(1, false));
	String srcGroupTile = Messages.getString("dialog.TmMatchEditDialog.component.src");
	srcGroupTile = MessageFormat.format(srcGroupTile, fuzzyResult.getTu().getSource().getLangCode());
	srcGroup.setText(srcGroupTile);

	srcSegmentViewer = new SegmentViewer(srcGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, null);
	StyledText srcTextControl = srcSegmentViewer.getTextWidget();
	srcTextControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	srcTextControl.setLineSpacing(Constants.SEGMENT_LINE_SPACING);
	srcTextControl.setLeftMargin(Constants.SEGMENT_LEFT_MARGIN);
	srcTextControl.setRightMargin(Constants.SEGMENT_RIGHT_MARGIN);
	srcTextControl.setTopMargin(Constants.SEGMENT_TOP_MARGIN);
	srcTextControl.setBottomMargin(Constants.SEGMENT_TOP_MARGIN);
	srcTextControl.setFont(JFaceResources.getFont(Constants.MATCH_VIEWER_TEXT_FONT));

	Group targetGroup = new Group(container, SWT.NONE);
	targetGroup.setLayout(new GridLayout(1, false));
	targetGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	String tgtGroupTile = Messages.getString("dialog.TmMatchEditDialog.component.tgt");
	tgtGroupTile = MessageFormat.format(tgtGroupTile, fuzzyResult.getTu().getSource().getLangCode());
	targetGroup.setText(tgtGroupTile);

	tgtSegmentViewer = new SegmentViewer(targetGroup, SWT.MULTI | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL, null);
	StyledText tgtTextControl = tgtSegmentViewer.getTextWidget();
	tgtTextControl.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	tgtTextControl.setLineSpacing(Constants.SEGMENT_LINE_SPACING);
	tgtTextControl.setLeftMargin(Constants.SEGMENT_LEFT_MARGIN);
	tgtTextControl.setRightMargin(Constants.SEGMENT_RIGHT_MARGIN);
	tgtTextControl.setTopMargin(Constants.SEGMENT_TOP_MARGIN);
	tgtTextControl.setBottomMargin(Constants.SEGMENT_TOP_MARGIN);
	tgtTextControl.setFont(JFaceResources.getFont(Constants.MATCH_VIEWER_TEXT_FONT));

	net.heartsome.cat.ts.ui.innertag.tagstyle.TagStyleConfigurator.configure(srcSegmentViewer);
	net.heartsome.cat.ts.ui.innertag.tagstyle.TagStyleConfigurator.configure(tgtSegmentViewer);

	TmMatchEditorBodyMenu srcMenu = new TmMatchEditorBodyMenu(srcSegmentViewer);
	srcSegmentViewer.getTextWidget().setMenu(srcMenu.getBodyMenu());

	TmMatchEditorBodyMenu tgtMenu = new TmMatchEditorBodyMenu(tgtSegmentViewer);
	tgtSegmentViewer.getTextWidget().setMenu(tgtMenu.getBodyMenu());

	loadData();

	return container;
}
 
Example 19
Source File: SearchDialog.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
private void createTableCheckboxGroup(final Composite parent) {
    final GridData gridData = new GridData();
    gridData.horizontalSpan = NUM_COLUMNS - 1;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    final GridLayout gridLayout = new GridLayout();
    gridLayout.numColumns = 4;

    final Group group = new Group(parent, SWT.NONE);
    group.setLayout(gridLayout);
    group.setLayoutData(gridData);

    physicalTableNameCheckBox = new Button(group, SWT.CHECK);
    physicalTableNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.11"));

    logicalTableNameCheckBox = new Button(group, SWT.CHECK);
    logicalTableNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.12"));

    columnGroupNameCheckBox = new Button(group, SWT.CHECK);
    columnGroupNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.20"));

    new Label(group, SWT.NONE);

    physicalColumnNameCheckBox = new Button(group, SWT.CHECK);
    physicalColumnNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.13"));

    logicalColumnNameCheckBox = new Button(group, SWT.CHECK);
    logicalColumnNameCheckBox.setText(ResourceString.getResourceString("search.result.row.name.14"));

    columnTypeCheckBox = new Button(group, SWT.CHECK);
    columnTypeCheckBox.setText(ResourceString.getResourceString("search.result.row.name.15"));

    columnLengthCheckBox = new Button(group, SWT.CHECK);
    columnLengthCheckBox.setText(ResourceString.getResourceString("search.result.row.name.16"));

    columnDecimalCheckBox = new Button(group, SWT.CHECK);
    columnDecimalCheckBox.setText(ResourceString.getResourceString("search.result.row.name.17"));

    columnDefaultValueCheckBox = new Button(group, SWT.CHECK);
    columnDefaultValueCheckBox.setText(ResourceString.getResourceString("search.result.row.name.18"));

    columnDescriptionCheckBox = new Button(group, SWT.CHECK);
    columnDescriptionCheckBox.setText(ResourceString.getResourceString("search.result.row.name.19"));
}
 
Example 20
Source File: SWTUtil.java    From APICloud-Studio with GNU General Public License v3.0 3 votes vote down vote up
/**
 * Creates a Group widget
 * 
 * @param parent
 *            the parent composite to add this group to
 * @param text
 *            the text for the heading of the group
 * @param columns
 *            the number of columns within the group
 * @param hspan
 *            the horizontal span the group should take up on the parent
 * @param fill
 *            the style for how this composite should fill into its parent
 * @return the new group
 * @since 3.2
 */
public static Group createGroup(Composite parent, String text, int columns, int hspan, int fill)
{
	Group g = new Group(parent, SWT.NONE);
	g.setLayout(new GridLayout(columns, false));
	g.setText(text);
	g.setFont(parent.getFont());
	GridData gd = new GridData(fill);
	gd.horizontalSpan = hspan;
	g.setLayoutData(gd);
	return g;
}