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

The following examples show how to use org.eclipse.swt.SWT#SHADOW_ETCHED_IN . These examples are extracted from open source projects. 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
protected void optionsSectionLayout( Class<?> PKG, String prefix ) {
  gDetails = new Group( cContainer, SWT.SHADOW_ETCHED_IN );
  gDetails.setText( BaseMessages.getString( PKG, prefix + ".DetailsGroup.Label" ) );
  props.setLook( gDetails );

  // The layout
  gDetails.setLayout( new FormLayout() );
  fdDetails = new FormData();
  fdDetails.top = new FormAttachment( cRunConfiguration, Const.FORM_MARGIN );
  fdDetails.right = new FormAttachment( 100, -Const.FORM_MARGIN );
  fdDetails.left = new FormAttachment( 0, Const.FORM_MARGIN );
  gDetails.setBackground( shell.getBackground() ); // the default looks ugly
  gDetails.setLayoutData( fdDetails );

  optionsSectionControls();
}
 
Example 2
Source Project: arx   File: HierarchyWizardEditorRange.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param parent
 * @param model
 * @param lower
 */
@SuppressWarnings("unchecked")
public HierarchyWizardEditorRange(final Composite parent,
                                 final HierarchyWizardModelGrouping<T> model,
                                 final boolean lower) {

    this.composite = new Group(parent, SWT.SHADOW_ETCHED_IN);
    this.composite.setText(lower ? Resources.getMessage("HierarchyWizardEditorRange.0") : Resources.getMessage("HierarchyWizardEditorRange.1")); //$NON-NLS-1$ //$NON-NLS-2$
    this.composite.setLayout(SWTUtil.createGridLayout(2, false));
    this.composite.setLayoutData(SWTUtil.createFillHorizontallyGridData());
    this.type = (DataTypeWithRatioScale<T>)model.getDataType();
    this.model = model;
    this.model.register(this);
    if (!lower) {
        this.range = model.getUpperRange();
        createSnap(model, lower, range);
        createTopBottomCoding(model, lower, range);
        createMinMax(model, lower, range);
    }
    else {
        this.range = model.getLowerRange();
        createMinMax(model, lower, range);
        createTopBottomCoding(model, lower, range);
        createSnap(model, lower, range);
    }
}
 
Example 3
public Group createGroupCommand(Composite parent) {
    Font font = parent.getFont();
    Group pageGroupCommand = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroupCommand.setText(Activator.getResourceString("easyshell.command.editor.dialog.title.group1"));
    pageGroupCommand.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.tooltip.group1"));
    GridLayout layoutCommand = new GridLayout();
    layoutCommand.numColumns = 3;
    layoutCommand.makeColumnsEqualWidth = false;
    layoutCommand.marginWidth = 5;
    layoutCommand.marginHeight = 4;
    pageGroupCommand.setLayout(layoutCommand);
    GridData dataCommand = new GridData(GridData.FILL_HORIZONTAL);
    pageGroupCommand.setLayoutData(dataCommand);
    pageGroupCommand.setFont(font);
    return pageGroupCommand;
}
 
Example 4
private void createVariablesOverview(Composite parent) {
    Font font = parent.getFont();
    Group pageGroup2 = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroup2.setText(Activator.getResourceString("easyshell.command.editor.dialog.title.group2"));
    pageGroup2.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.tooltip.group2"));
    GridLayout layout2 = new GridLayout();
    layout2.numColumns = 2;
    layout2.makeColumnsEqualWidth = false;
    layout2.marginWidth = 5;
    layout2.marginHeight = 4;
    pageGroup2.setLayout(layout2);
    GridData data2 = new GridData(GridData.FILL_HORIZONTAL);
    pageGroup2.setLayoutData(data2);
    pageGroup2.setFont(font);
    // create variable labels
    for(int i=Variable.getFirstIndex();i<Variable.values().length;i++) {
        Variable var = Variable.values()[i];
        if (var.isVisible()) {
            createVariableLabel(pageGroup2, var.getFullVariableName(), ": " + var.getDescription());
        }
    }
}
 
Example 5
private void createConvertersOverview(Composite parent) {
    Font font = parent.getFont();
    Group pageGroup3 = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroup3.setText(Activator.getResourceString("easyshell.command.editor.dialog.title.group3"));
    pageGroup3.setToolTipText(Activator.getResourceString("easyshell.command.editor.dialog.tooltip.group3"));
    GridLayout layout3 = new GridLayout();
    layout3.numColumns = 2;
    layout3.makeColumnsEqualWidth = false;
    layout3.marginWidth = 5;
    layout3.marginHeight = 4;
    pageGroup3.setLayout(layout3);
    GridData data3 = new GridData(GridData.FILL_HORIZONTAL);
    pageGroup3.setLayoutData(data3);
    pageGroup3.setFont(font);
    // create converters labels
    for(int i=Converter.getFirstIndex();i<Converter.values().length;i++) {
        Converter conv = Converter.values()[i];
        if (conv.isVisible()) {
            createVariableLabel(pageGroup3, conv.getName(), ": " + conv.getDescription());
        }
    }
}
 
Example 6
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 7
public Group createGroupMenu(Composite parent) {
    Font font = parent.getFont();
    Group pageGroupMenu = new Group(parent, SWT.SHADOW_ETCHED_IN);
    pageGroupMenu.setText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.menu"));
    pageGroupMenu.setToolTipText(Activator.getResourceString("easyshell.menu.editor.dialog.title.group.tooltip.menu"));
    GridLayout layoutMenu = new GridLayout();
    layoutMenu.numColumns = 3;
    layoutMenu.makeColumnsEqualWidth = false;
    layoutMenu.marginWidth = 5;
    layoutMenu.marginHeight = 4;
    pageGroupMenu.setLayout(layoutMenu);
    GridData gridDataMenu = new GridData(GridData.FILL_HORIZONTAL);
    pageGroupMenu.setLayoutData(gridDataMenu);
    pageGroupMenu.setFont(font);
    return pageGroupMenu;
}
 
Example 8
Source Project: pentaho-kettle   File: ConnectionForm.java    License: Apache License 2.0 5 votes vote down vote up
Group layoutForm() {
  FormLayout setupLayout = new FormLayout();
  setupLayout.marginHeight = 15;
  setupLayout.marginWidth = 15;
  parentComponent.setLayout( setupLayout );

  wConnectionGroup = new Group( parentComponent, SWT.SHADOW_ETCHED_IN );
  wConnectionGroup.setText( getString( PKG, "JmsDialog.Connection" ) );

  FormLayout flConnection = new FormLayout();
  flConnection.marginHeight = 15;
  flConnection.marginWidth = 15;
  wConnectionGroup.setLayout( flConnection );

  FormData fdConnectionGroup = new FormData();
  fdConnectionGroup.left = new FormAttachment( 0, 0 );
  fdConnectionGroup.top = new FormAttachment( 0, 0 );
  fdConnectionGroup.right = new FormAttachment( 100, 0 );
  fdConnectionGroup.width = INPUT_WIDTH;
  wConnectionGroup.setLayoutData( fdConnectionGroup );

  props.setLook( wConnectionGroup );

  displayConnTypes( wConnectionGroup );

  setStartingsVals();

  return wConnectionGroup;
}
 
Example 9
Source Project: http4e   File: LiveSashForm.java    License: Apache License 2.0 5 votes vote down vote up
private void drawBorderAround(Control c, GC gc)
{
  int sh = getChildBorder(c);
  if(sh == SWT.SHADOW_NONE) return;

  Display disp = getDisplay();
  Color shadow = disp.getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW);
  Color highlight = disp.getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW);
  if(shadow == null || highlight == null) return;
  Rectangle r = c.getBounds();

  switch(sh)
  {
    case SWT.SHADOW_IN:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, shadow, highlight);
      break;

    case SWT.SHADOW_OUT:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, highlight, shadow);
      break;

    case SWT.SHADOW_ETCHED_IN:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, highlight, shadow);
      drawBevelRect(gc, r.x-2, r.y-2, r.width+3, r.height+3, shadow, highlight);
      break;

    case SWT.SHADOW_ETCHED_OUT:
      drawBevelRect(gc, r.x-1, r.y-1, r.width+1, r.height+1, shadow, highlight);
      drawBevelRect(gc, r.x-2, r.y-2, r.width+3, r.height+3, highlight, shadow);
      break;
  }
}
 
Example 10
Source Project: pentaho-kettle   File: AuthComposite.java    License: Apache License 2.0 5 votes vote down vote up
private void layoutComposite() {
  FormLayout flAuthComp = new FormLayout();
  this.setLayout( flAuthComp );

  //authentication group
  wAuthGroup = new Group( this, SWT.SHADOW_ETCHED_IN );
  props.setLook( wAuthGroup );
  wAuthGroup.setText( authGroupLabel );

  FormLayout flAuthGroup = new FormLayout();
  flAuthGroup.marginHeight = 15;
  flAuthGroup.marginWidth = 15;
  wAuthGroup.setLayout( flAuthGroup );
  wAuthGroup.setLayoutData( new FormDataBuilder().fullSize().result() );

  //username
  wlUsername = new Label( wAuthGroup, SWT.LEFT );
  props.setLook( wlUsername );
  wlUsername.setText( usernameLabel );
  wlUsername.setLayoutData( new FormDataBuilder().left().top().result() );

  wUsername = new TextVar( transMeta, wAuthGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wUsername );
  wUsername.addModifyListener( lsMod );
  wUsername.setLayoutData( new FormDataBuilder().top( wlUsername ).left().width( INPUT_WIDTH ).result() );

  //password
  wlPassword = new Label( wAuthGroup, SWT.LEFT );
  props.setLook( wlPassword );
  wlPassword.setText( passwordLabel );
  wlPassword.setLayoutData( new FormDataBuilder().left().top( wUsername, ConstUI.MEDUIM_MARGIN ).result() );

  wPassword = new PasswordTextVar( transMeta, wAuthGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wPassword );
  wPassword.addModifyListener( lsMod );
  wPassword.setLayoutData( new FormDataBuilder().left().top( wlPassword ).width( INPUT_WIDTH ).result() );
}
 
Example 11
/**
 * Creates the direction defining part of the options defining section of
 * the find dialog.
 *
 * @param parent
 *            the parent composite
 * @return the direction defining part
 */
private Composite createDirectionGroup(Composite parent) {

    Composite panel = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    panel.setLayout(layout);

    Group group = new Group(panel, SWT.SHADOW_ETCHED_IN);
    group.setText(Messages.TimeGraphFindDialog_Direction);
    GridLayout groupLayout = new GridLayout();
    group.setLayout(groupLayout);
    group.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    fForwardRadioButton = new Button(group, SWT.RADIO | SWT.LEFT);
    fForwardRadioButton.setText(Messages.TimeGraphFindDialog_ForwardRadioButtonLabel);
    setGridData(fForwardRadioButton, SWT.LEFT, false, SWT.CENTER, false);
    storeButtonWithMnemonicInMap(fForwardRadioButton);

    Button backwardRadioButton = new Button(group, SWT.RADIO | SWT.LEFT);
    backwardRadioButton.setText(Messages.TimeGraphFindDialog_BackwardRadioButtonLabel);
    setGridData(backwardRadioButton, SWT.LEFT, false, SWT.CENTER, false);
    storeButtonWithMnemonicInMap(backwardRadioButton);

    backwardRadioButton.setSelection(!fForwardInit);
    fForwardRadioButton.setSelection(fForwardInit);

    return panel;
}
 
Example 12
@Override
protected void createFieldEditors() {
    Composite composite = new Composite(getFieldEditorParent(), SWT.NONE);

    GridLayoutFactory.fillDefaults() //
            .numColumns(2) //
            .margins(5, 8) //
            .spacing(5, 20) //
            .applyTo(composite);

    Group group = new Group(composite, SWT.SHADOW_ETCHED_IN);
    GridDataFactory.fillDefaults().span(2, 1).applyTo(group);

    group.setText("Allow JSON references in additional contexts");

    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_DEFINITIONS_OBJECT, "Security Definitions Object",
            group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_SCHEME_OBJECT, "Security Scheme Object", group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENTS_ARRAY, "Security Requirements Array",
            group));
    addField(new BooleanFieldEditor(VALIDATION_REF_SECURITY_REQUIREMENT_OBJECT, "Security Requirement Object",
            group));

    // FieldEditor set parent layout to GridLayout with margin = 0
    ((GridLayout) group.getLayout()).marginTop = 8;
    ((GridLayout) group.getLayout()).marginBottom = 8;
    ((GridLayout) group.getLayout()).marginLeft = 8;
    ((GridLayout) group.getLayout()).marginRight = 8;

    // Validation

    Set<PreferenceProvider> providers = ExtensionUtils.getPreferenceProviders(VALIDATION_PREFERENCE_PAGE);
    providers.forEach(provider -> {
        for (FieldEditor field : provider.createFields(Version.SWAGGER, composite)) {
            addField(field);
        }
    });
}
 
Example 13
Source Project: EasyShell   File: MainPage.java    License: Eclipse Public License 2.0 5 votes vote down vote up
private Group createGroup1(Composite pageComponent) {
    Group pageGroup = new Group(pageComponent, SWT.SHADOW_ETCHED_IN);
    pageGroup.setText(Activator.getResourceString("easyshell.main.page.title.group1"));
    pageGroup.setToolTipText(Activator.getResourceString("easyshell.main.page.tooltip.group1"));
    GridLayout layout = new GridLayout();
    layout.numColumns = 1;
    layout.makeColumnsEqualWidth = false;
    layout.marginWidth = 5;
    layout.marginHeight = 4;
    pageGroup.setLayout(layout);
    GridData data = new GridData(GridData.FILL_HORIZONTAL);
    pageGroup.setLayoutData(data);
    pageGroup.setFont(pageComponent.getFont());
    return pageGroup;
}
 
Example 14
public XkcdColorPicker(Composite parent, RGB initRGB) {
	super(new Composite(parent, SWT.NONE));
	RGB initYCbCr = ColorPicker.toYCbCr(initRGB);

	// create a scale and bind it to an RxBox<Integer>
	RxBox<Integer> luminance = RxBox.of(initYCbCr.red);

	// colorpanel in the center
	ColorPicker cbcrPanel = new ColorPicker(wrapped);
	Rx.subscribe(luminance, cbcrPanel::setY);

	// controls at the right
	Composite rightCmp = new Composite(wrapped, SWT.NONE);

	// scale below
	Scale scale = new Scale(wrapped, SWT.HORIZONTAL);
	scale.setMinimum(0);
	scale.setMaximum(255);
	Rx.subscribe(luminance, scale::setSelection);
	scale.addListener(SWT.Selection, e -> {
		luminance.set(scale.getSelection());
	});

	Layouts.setGrid(wrapped).numColumns(2);
	Layouts.setGridData(cbcrPanel).grabAll();
	Layouts.setGridData(rightCmp).grabVertical().verticalSpan(2);
	Layouts.setGridData(scale).grabHorizontal();

	// populate the bottom
	Layouts.setGrid(rightCmp).margin(0);
	XkcdColors.Lookup xkcdLookup = new XkcdColors.Lookup(rightCmp);

	Group hoverGrp = new Group(rightCmp, SWT.SHADOW_ETCHED_IN);
	hoverGrp.setText("Hover");
	createGroup(hoverGrp, cbcrPanel.rxMouseMove(), xkcdLookup);

	Group clickGrp = new Group(rightCmp, SWT.SHADOW_ETCHED_IN);
	clickGrp.setText("Click");
	createGroup(clickGrp, cbcrPanel.rxMouseDown(), xkcdLookup);
}
 
Example 15
private void createBasicOptionsGroup(Composite composite) {

		fTitleButton= createButton(composite, SWT.CHECK, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_label, createGridData(1));
		fTitleText= createText(composite, SWT.SINGLE | SWT.BORDER, null, createGridData(GridData.FILL_HORIZONTAL, 3, 0));
		SWTUtil.setAccessibilityText(fTitleText, JavadocExportMessages.JavadocStandardWizardPage_titlebutton_description);

		String text= fStore.getTitle();
		if (!text.equals("")) { //$NON-NLS-1$
			fTitleText.setText(text);
			fTitleButton.setSelection(true);
		} else
			fTitleText.setEnabled(false);

		fBasicOptionsGroup= new Group(composite, SWT.SHADOW_ETCHED_IN);
		fBasicOptionsGroup.setLayout(createGridLayout(1));
		fBasicOptionsGroup.setLayoutData(createGridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL, 2, 0));
		fBasicOptionsGroup.setText(JavadocExportMessages.JavadocStandardWizardPage_basicgroup_label);

		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_usebutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.USE, true);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_hierarchybutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOTREE, false);
		new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_navigartorbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NONAVBAR, false);

		fIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_indexbutton_label, new GridData(GridData.FILL_HORIZONTAL), fStore.NOINDEX, false);

		fSeperatedIndexCheck= new FlaggedButton(fBasicOptionsGroup, JavadocExportMessages.JavadocStandardWizardPage_seperateindexbutton_label, createGridData(GridData.GRAB_HORIZONTAL, 1,
				LayoutUtil.getIndent()), fStore.SPLITINDEX, true);
		fSeperatedIndexCheck.getButton().setEnabled(fIndexCheck.getButton().getSelection());

		fIndexCheck.getButton().addSelectionListener(new ToggleSelectionAdapter(new Control[] { fSeperatedIndexCheck.getButton()}));
		fTitleButton.addSelectionListener(new ToggleSelectionAdapter(new Control[] { fTitleText }));

	}
 
Example 16
Source Project: pentaho-kettle   File: TopicSelection.java    License: 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 );

  wTopicGroup.setLayoutData( new FormDataBuilder().top( 0, ConstUI.MEDUIM_MARGIN ).fullWidth().bottom().result() );

  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 );

  wTopicFromText.setLayoutData( new FormDataBuilder().left().top().result() );

  wTopicFromField.setLayoutData( new FormDataBuilder().left().top( wTopicFromText ).result() );
  wTopicFromField.addSelectionListener( selectionListener );
  wTopicFromText.addSelectionListener( selectionListener );

  Label separator = new Label( wTopicGroup, SWT.SEPARATOR | SWT.VERTICAL );
  separator.setLayoutData( new FormDataBuilder().top().left( wTopicFromField, 15 ).bottom().result() );

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

  if ( displayTopicErrorIcon ) {
    //Connection Error Icon label
    wlTopic.setLayoutData( new FormDataBuilder().top().left( separator, 15 ).result() );

    wlConnectionError = new Label( wTopicGroup, SWT.LEFT );
    wlConnectionError.setToolTipText( fieldTopicErrorToolTip );
    wlConnectionError.setImage( SwtSvgImageUtil.getImage(
      this.getDisplay(), getClass().getClassLoader(), "error.svg", ConstUI.SMALL_ICON_SIZE,
      ConstUI.SMALL_ICON_SIZE ) );
    props.setLook( wlConnectionError );

    wlConnectionError.setLayoutData( new FormDataBuilder().top().left( wlTopic, MARGIN ).result() );
    wlConnectionError.setVisible( false );
  } else {
    wlTopic.setLayoutData( new FormDataBuilder().top().left( separator, 15 ).right().result() );
  }

  FormData fdTopic = new FormDataBuilder().top( wlTopic ).left( separator, 15 ).right().result();

  wTopicTextCombo = new ComboVar( transMeta, wTopicGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wTopicTextCombo );
  wTopicTextCombo.setLayoutData( fdTopic );
  wTopicTextCombo.addModifyListener( lsMod );

  wTopicText = new TextVar( transMeta, wTopicGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  props.setLook( wTopicText );
  wTopicText.setLayoutData( fdTopic );
  wTopicText.addModifyListener( lsMod );

  wTopicField = createFieldDropDown( wTopicGroup, props, stepMeta, fdTopic );
  props.setLook( wTopicField );
  wTopicField.setLayoutData( fdTopic );
  setTopicWidgetVisibility( wTopicFromField );
  wTopicField.addModifyListener( lsMod );
}
 
Example 17
Source Project: hop   File: TopicSelection.java    License: 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 Project: hop   File: AbortDialog.java    License: Apache License 2.0 4 votes vote down vote up
private void buildOptions( Control widgetAbove ) {
  wOptionsGroup = new Group( shell, SWT.SHADOW_ETCHED_IN );
  props.setLook( wOptionsGroup );
  wOptionsGroup.setText( BaseMessages.getString( PKG, "AbortDialog.Options.Group.Label" ) );
  FormLayout flOptionsGroup = new FormLayout();
  flOptionsGroup.marginHeight = 15;
  flOptionsGroup.marginWidth = 15;
  wOptionsGroup.setLayout( flOptionsGroup );

  FormData fdOptionsGroup = new FormData();
  fdOptionsGroup.left = new FormAttachment( 0, 0 );
  fdOptionsGroup.top = new FormAttachment( widgetAbove, 15 );
  fdOptionsGroup.right = new FormAttachment( 100, 0 );
  wOptionsGroup.setLayoutData( fdOptionsGroup );

  wAbortButton = new Button( wOptionsGroup, SWT.RADIO );
  wAbortButton.addSelectionListener( lsSelMod );
  wAbortButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.Abort.Label" ) );
  FormData fdAbort = new FormData();
  fdAbort.left = new FormAttachment( 0, 0 );
  fdAbort.top = new FormAttachment( 0, 0 );
  wAbortButton.setLayoutData( fdAbort );
  props.setLook( wAbortButton );

  wAbortWithErrorButton = new Button( wOptionsGroup, SWT.RADIO );
  wAbortWithErrorButton.addSelectionListener( lsSelMod );
  wAbortWithErrorButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.AbortWithError.Label" ) );
  FormData fdAbortWithError = new FormData();
  fdAbortWithError.left = new FormAttachment( 0, 0 );
  fdAbortWithError.top = new FormAttachment( wAbortButton, 10 );
  wAbortWithErrorButton.setLayoutData( fdAbortWithError );
  props.setLook( wAbortWithErrorButton );

  wSafeStopButton = new Button( wOptionsGroup, SWT.RADIO );
  wSafeStopButton.addSelectionListener( lsSelMod );
  wSafeStopButton.setText( BaseMessages.getString( PKG, "AbortDialog.Options.SafeStop.Label" ) );
  FormData fdSafeStop = new FormData();
  fdSafeStop.left = new FormAttachment( 0, 0 );
  fdSafeStop.top = new FormAttachment( wAbortWithErrorButton, 10 );
  wSafeStopButton.setLayoutData( fdSafeStop );
  props.setLook( wSafeStopButton );

  wlRowThreshold = new Label( wOptionsGroup, SWT.RIGHT );
  wlRowThreshold.setText( BaseMessages.getString( PKG, "AbortDialog.Options.RowThreshold.Label" ) );
  props.setLook( wlRowThreshold );
  fdlRowThreshold = new FormData();
  fdlRowThreshold.left = new FormAttachment( 0, 0 );
  fdlRowThreshold.top = new FormAttachment( wSafeStopButton, 10 );
  wlRowThreshold.setLayoutData( fdlRowThreshold );

  wRowThreshold = new TextVar( pipelineMeta, wOptionsGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wRowThreshold.setText( "" );
  props.setLook( wRowThreshold );
  wRowThreshold.addModifyListener( lsMod );
  wRowThreshold.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Options.RowThreshold.Tooltip" ) );
  fdRowThreshold = new FormData();
  fdRowThreshold.left = new FormAttachment( 0, 0 );
  fdRowThreshold.top = new FormAttachment( wlRowThreshold, 5 );
  fdRowThreshold.width = 174;
  wRowThreshold.setLayoutData( fdRowThreshold );
}
 
Example 19
Source Project: hop   File: AbortDialog.java    License: Apache License 2.0 4 votes vote down vote up
private void buildLogging( Composite widgetAbove ) {
  wLoggingGroup = new Group( shell, SWT.SHADOW_ETCHED_IN );
  props.setLook( wLoggingGroup );
  wLoggingGroup.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.Group" ) );
  FormLayout flLoggingGroup = new FormLayout();
  flLoggingGroup.marginHeight = 15;
  flLoggingGroup.marginWidth = 15;
  wLoggingGroup.setLayout( flLoggingGroup );

  FormData fdLoggingGroup = new FormData();
  fdLoggingGroup.left = new FormAttachment( 0, 0 );
  fdLoggingGroup.top = new FormAttachment( widgetAbove, 15 );
  fdLoggingGroup.right = new FormAttachment( 100, 0 );
  fdLoggingGroup.bottom = new FormAttachment( hSpacer, -15 );
  wLoggingGroup.setLayoutData( fdLoggingGroup );

  wlMessage = new Label( wLoggingGroup, SWT.RIGHT );
  wlMessage.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Label" ) );
  props.setLook( wlMessage );
  fdlMessage = new FormData();
  fdlMessage.left = new FormAttachment( 0, 0 );
  fdlMessage.top = new FormAttachment( 0, 0 );
  wlMessage.setLayoutData( fdlMessage );

  wMessage = new TextVar( pipelineMeta, wLoggingGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wMessage.setText( "" );
  props.setLook( wMessage );
  wMessage.addModifyListener( lsMod );
  wMessage.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Tooltip" ) );
  fdMessage = new FormData();
  fdMessage.left = new FormAttachment( 0, 0 );
  fdMessage.top = new FormAttachment( wlMessage, 5 );
  fdMessage.right = new FormAttachment( 100, 0 );
  wMessage.setLayoutData( fdMessage );

  wAlwaysLogRows = new Button( wLoggingGroup, SWT.CHECK );
  wAlwaysLogRows.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Label" ) );
  props.setLook( wAlwaysLogRows );
  wAlwaysLogRows.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Tooltip" ) );
  fdAlwaysLogRows = new FormData();
  fdAlwaysLogRows.left = new FormAttachment( 0, 0 );
  fdAlwaysLogRows.top = new FormAttachment( wMessage, 10 );
  wAlwaysLogRows.setLayoutData( fdAlwaysLogRows );
  wAlwaysLogRows.addSelectionListener( lsSelMod );
}
 
Example 20
Source Project: pentaho-kettle   File: AbortDialog.java    License: Apache License 2.0 4 votes vote down vote up
private void buildLogging( Composite widgetAbove ) {
  wLoggingGroup = new Group( shell, SWT.SHADOW_ETCHED_IN );
  props.setLook( wLoggingGroup );
  wLoggingGroup.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.Group" ) );
  FormLayout flLoggingGroup = new FormLayout();
  flLoggingGroup.marginHeight = 15;
  flLoggingGroup.marginWidth = 15;
  wLoggingGroup.setLayout( flLoggingGroup );

  FormData fdLoggingGroup = new FormData();
  fdLoggingGroup.left = new FormAttachment( 0, 0 );
  fdLoggingGroup.top = new FormAttachment( widgetAbove, 15 );
  fdLoggingGroup.right = new FormAttachment( 100, 0 );
  fdLoggingGroup.bottom = new FormAttachment( hSpacer, -15 );
  wLoggingGroup.setLayoutData( fdLoggingGroup );

  wlMessage = new Label( wLoggingGroup, SWT.RIGHT );
  wlMessage.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Label" ) );
  props.setLook( wlMessage );
  fdlMessage = new FormData();
  fdlMessage.left = new FormAttachment( 0, 0 );
  fdlMessage.top = new FormAttachment( 0, 0 );
  wlMessage.setLayoutData( fdlMessage );

  wMessage = new TextVar( transMeta, wLoggingGroup, SWT.SINGLE | SWT.LEFT | SWT.BORDER );
  wMessage.setText( "" );
  props.setLook( wMessage );
  wMessage.addModifyListener( lsMod );
  wMessage.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AbortMessage.Tooltip" ) );
  fdMessage = new FormData();
  fdMessage.left = new FormAttachment( 0, 0 );
  fdMessage.top = new FormAttachment( wlMessage, 5 );
  fdMessage.right = new FormAttachment( 100, 0 );
  wMessage.setLayoutData( fdMessage );

  wAlwaysLogRows = new Button( wLoggingGroup, SWT.CHECK );
  wAlwaysLogRows.setText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Label" ) );
  props.setLook( wAlwaysLogRows );
  wAlwaysLogRows.setToolTipText( BaseMessages.getString( PKG, "AbortDialog.Logging.AlwaysLogRows.Tooltip" ) );
  fdAlwaysLogRows = new FormData();
  fdAlwaysLogRows.left = new FormAttachment( 0, 0 );
  fdAlwaysLogRows.top = new FormAttachment( wMessage, 10 );
  wAlwaysLogRows.setLayoutData( fdAlwaysLogRows );
  wAlwaysLogRows.addSelectionListener( lsSelMod );
}