Java Code Examples for org.eclipse.swt.widgets.Label#setToolTipText()

The following examples show how to use org.eclipse.swt.widgets.Label#setToolTipText() . 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: ViewerConfigDialog.java    From texlipse with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates the additional controls of the page.
 * @param parent parent component
 */
private void addInverseChooser(Composite parent) {
    
    Label label = new Label(parent, SWT.LEFT);
    label.setText(TexlipsePlugin.getResourceString("preferenceViewerInverseLabel"));
    label.setToolTipText(TexlipsePlugin.getResourceString("preferenceViewerInverseTooltip"));
    label.setLayoutData(new GridData());
    
    String[] list = new String[] {
            TexlipsePlugin.getResourceString("preferenceViewerInverseSearchNo"),
            TexlipsePlugin.getResourceString("preferenceViewerInverseSearchRun"),
            TexlipsePlugin.getResourceString("preferenceViewerInverseSearchStd")
    };
    
    // find out which option to choose by default
    int index = inverseSearchValues.length - 1;
    for (; index > 0 && !inverseSearchValues[index].equals(registry.getInverse()); index--) {}
    
    
    inverseChooser = new Combo(parent, SWT.DROP_DOWN | SWT.READ_ONLY);
    inverseChooser.setLayoutData(new GridData());
    inverseChooser.setToolTipText(TexlipsePlugin.getResourceString("preferenceViewerInverseTooltip"));
    inverseChooser.setItems(list);
    inverseChooser.select(index);
}
 
Example 2
Source File: AbstractDescriptionPropertyPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public Control createPageControl(Composite parent)
{
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout( );
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    composite.setLayout(layout);
    if(getPageDescription() != null)
    {
        pageDescription = new Label(composite, SWT.NONE);
        pageDescription.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        pageDescription.setText(getPageDescription());
        pageDescription.setToolTipText(getPageDescription());
    }
    GridData data = new GridData(GridData.FILL_BOTH);
    Control control = createContents(composite);
    control.setLayoutData(data);
    return composite;
}
 
Example 3
Source File: FlexDeployPreferencesPanel.java    From google-cloud-eclipse with Apache License 2.0 6 votes vote down vote up
/**
 * Helper method to create a row of a {@link Label}, a {@link Text} for a file path input, and
 * a "browse" {@link Button} to open a {@link FileDialog}.
 *
 * @param fileFieldBasePath a base path that file input fields will treat as a prefix. The path is
 * for 1) relativizing absolute paths in file input fields; and 2) setting the default path for
 * the file chooser dialog.
 */
protected Text createBrowseFileRow(String labelText, String Tooltip,
    IPath fileFieldBasePath, String[] fileDialogfilterExtensions) {
  Label label = new Label(this, SWT.LEAD);
  label.setText(labelText);
  label.setToolTipText(Tooltip);

  Composite secondColumn = new Composite(this, SWT.NONE);
  Text fileField = new Text(secondColumn, SWT.SINGLE | SWT.BORDER);
  fileField.setToolTipText(Tooltip);

  Button browse = new Button(secondColumn, SWT.PUSH);
  browse.setText(Messages.getString("deploy.preferences.dialog.browse"));
  browse.addSelectionListener(
      new RelativeFileFieldSetter(fileField, fileFieldBasePath, fileDialogfilterExtensions));

  GridDataFactory.fillDefaults().applyTo(secondColumn);
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fileField);
  GridLayoutFactory.fillDefaults().numColumns(2).generateLayout(secondColumn);
  return fileField;
}
 
Example 4
Source File: DQSystemInfoPage.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
private void createUncertaintyMatrix(Composite composite) {
	UI.gridLayout(composite, 2 * getModel().getScoreCount() + 1);
	createHeader(composite, false);
	for (DQIndicator indicator : getModel().indicators) {
		String name = indicator.name != null ? indicator.name : "";
		Label label = toolkit.createLabel(composite, name);
		label.setToolTipText(name);
		setGridData(label, 1, 15);
		Text indicatorText = indicatorTexts.get(indicator.position);
		indicatorText.addModifyListener((e) -> {
			label.setText(indicatorText.getText());
			label.setToolTipText(indicatorText.getText());
		});
		for (DQScore score : indicator.scores) {
			Text uncertaintyText = createTextCell(composite, 1, 8);
			getBinding().onDouble(() -> score, "uncertainty", uncertaintyText);
			commentControl(composite, "indicators[" + indicator.position + "].scores[" + score.position
					+ "].uncertainty");
		}
	}
}
 
Example 5
Source File: XSPGenPage.java    From XPagesExtensionLibrary with Apache License 2.0 6 votes vote down vote up
private void createBrowserOptions(Composite parent) {
    Section rtSection = XSPEditorUtil.createSection(toolkit, parent, "Rich Text Options", 1, 1); // $NLX-XSPGenPage.RichTextOptions-1$
    Composite rtDCP = XSPEditorUtil.createSectionChild(rtSection, 2);
    rtDCP.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, false, false, 1, 1));
    Label lfLabel = XSPEditorUtil.createLabel(rtDCP, "Save links in:", 1); // $NLX-XSPGenPage.Savelinksin-1$
    lfLabel.setToolTipText("Defines how links should be saved in a Domino document"); // $NLX-XSPGenPage.DefineshowlinksshouldbesavedinaDo-1$
    Composite buttonHolder = new Composite(rtDCP, SWT.NONE);
    buttonHolder.setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    GridLayout gl = SWTLayoutUtils.createLayoutNoMarginDefaultSpacing(2);
    buttonHolder.setLayout(gl);
    buttonHolder.setLayoutData(new GridData(SWT.BEGINNING, SWT.FILL, false, false, 1, 1));
    XSPEditorUtil.createRadio(buttonHolder, LINK_SAVE_PROP, "Notes format", XSP_SAVE_USE_NOTES, "notesLinks", 1); //  $NON-NLS-2$ $NLX-XSPGenPage.Notesformat-1$
    XSPEditorUtil.createRadio(buttonHolder, LINK_SAVE_PROP, "Web format", XSP_SAVE_USE_WEB, "webLinks", 1); //  $NON-NLS-2$ $NLX-XSPGenPage.Webformat-1$

    rtSection.setClient(rtDCP);   
}
 
Example 6
Source File: PieSeriesAttributeComposite.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
protected void createRotation( Composite cmpRight )
{
	Label lblRotation = new Label( cmpRight, SWT.NONE );
	{
		lblRotation.setText( Messages.getString( "PieBottomAreaComponent.Label.Rotation" ) ); //$NON-NLS-1$
		lblRotation.setToolTipText( TOOLTIP_ROTATION );
	}

	sRotation = context.getUIFactory( ).createChartSlider( cmpRight,
			SWT.HORIZONTAL,
			series,
			"rotation" ); //$NON-NLS-1$
	{
		GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
		gridData.horizontalSpan = 2;
		sRotation.setLayoutData( gridData );
		sRotation.setValues( (int) ( series.getRotation( ) ),
				0,
				360,
				1,
				1,
				10,
				1 );
		sRotation.setToolTipText( String.valueOf( series.getRotation( ) ) );
		sRotation.setEnabled( true );
		sRotation.addSelectionListener( this );
	}
}
 
Example 7
Source File: StatechartDefinitionSection.java    From statecharts with Eclipse Public License 1.0 5 votes vote down vote up
public InlineIcon(Composite parent, int style) {
	super(parent, style);
	GridLayoutFactory.fillDefaults().applyTo(this);
	icon = new Label(this, style);
	icon.setCursor(handCursor);
	icon.setImage(StatechartImages.PIN.image());
	icon.setToolTipText(INLINE_TOOLTIP);
	icon.setEnabled(isStatechart());
	icon.addMouseListener(this);
	icon.addMouseTrackListener(this);
	icon.addPaintListener(this);
}
 
Example 8
Source File: ImageSection.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void createControls(File f) {
	Label header = tk.createLabel(comp, Strings.cut(f.getName(), 40));
	header.setToolTipText(f.getName());
	UI.gridData(header, false, false).verticalAlignment = SWT.BEGINNING;
	controls.add(header);
	Image img = new Image(comp.getDisplay(), f.getAbsolutePath());
	Label lab = tk.createLabel(comp, "");
	lab.setImage(img);
	lab.addDisposeListener(e -> {
		if (!img.isDisposed()) {
			img.dispose();
		}
	});
	controls.add(lab);
}
 
Example 9
Source File: RnFilterDialog.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea(final Composite parent){
	Composite ret = new Composite(parent, SWT.NONE);
	ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	ret.setLayout(new GridLayout(4, false));
	if (includeMoneySelector) {
		new Label(ret, SWT.NONE).setText(Messages.RnFilterDialog_amount); //$NON-NLS-1$
		miVon = new MoneyInput(ret, FROM);
		miBis = new MoneyInput(ret, UNTIL);
	}
	Label lblBillDate = new Label(ret, SWT.NONE);
	lblBillDate.setText(Messages.RnFilterDialog_billDate); //$NON-NLS-1$
	lblBillDate.setLayoutData(SWTHelper.getFillGridData(2, false, 1, true));
	diRnVon = new DateInput(ret, FROM);
	diRnBis = new DateInput(ret, UNTIL);
	
	Label lblStateDate = new Label(ret, SWT.NONE);
	lblStateDate.setText(Messages.RnFilterDialog_stateDate); //$NON-NLS-1$
	lblStateDate.setLayoutData(SWTHelper.getFillGridData(2, false, 1, true));
	diStatVon = new DateInput(ret, FROM);
	diStatBis = new DateInput(ret, UNTIL);
	
	Label lblOutputDate = new Label(ret, SWT.NONE);
	lblOutputDate.setText(Messages.RnFilterDialog_outputDate); //$NON-NLS-1$
	Label lblOutputDateInfo = new Label(ret, SWT.NONE);
	lblOutputDateInfo.setImage(Images.IMG_ACHTUNG.getImage());
	lblOutputDateInfo.setToolTipText(Messages.RnFilterDialog_outputDateInfo);
	diOutVon = new DateInput(ret, FROM);
	diOutBis = new DateInput(ret, UNTIL);
	return ret;
}
 
Example 10
Source File: UtilsUI.java    From EasyShell with Eclipse Public License 2.0 5 votes vote down vote up
static public void createLabel(Composite parent, String name, String tooltip) {
    Label label = new Label(parent, SWT.LEFT);
    label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
    label.setText(name);
    if (tooltip != null) {
        label.setToolTipText(tooltip);
    }
}
 
Example 11
Source File: ManifestEnvEditorPage.java    From XPagesExtensionLibrary with Apache License 2.0 5 votes vote down vote up
private void createRuntimeArea(Composite parent) {
    Section section = XSPEditorUtil.createSection(_toolkit, parent, "XPages Runtime Environment Variables", 1, 1); // $NLX-ManifestEnvEditorPage.XPagesRuntimeEnvironmentVariables-1$
    Composite container = XSPEditorUtil.createSectionChild(section, 3);
    
    // For de-indenting (MB) labels
    // Normal spacing is 20 so reduce to 5
    GridData gd = new GridData();
    gd.horizontalIndent = -15;
    
    Label tLabel = XSPEditorUtil.createLabel(container, "Home URL:", 1); // $NLX-ManifestEnvEditorPage.HomeURL-1$
    tLabel.setToolTipText("APP_HOME_URL\nUse to specify the NSF that will be used as the default URL route.\nShould include a leading forward slash and is the primary NSF by default."); // $NLX-ManifestEnvEditorPage.APP_HOME_URLnUsetospecifytheNSFth-1$
    XSPEditorUtil.createText(container, "appHomeUrl", 2, 0, 1); // $NON-NLS-1$

    tLabel = XSPEditorUtil.createLabel(container, "Preload DB:", 1); // $NLX-ManifestEnvEditorPage.PreloadDB-1$
    tLabel.setToolTipText("APP_PELOAD_DB\nUse to specify the NSF that should be preloaded during staging.\nPrimary NSF by default."); // $NLX-ManifestEnvEditorPage.APP_PELOAD_DBnUsetospecifytheNSFt-1$
    XSPEditorUtil.createText(container, "appPreloadDb", 2, 0, 1); // $NON-NLS-1$
    
    tLabel = XSPEditorUtil.createLabel(container, "JVM heap size:", 1); // $NLX-ManifestEnvEditorPage.JVMHeapsize-1$
    tLabel.setToolTipText("APP_JVM_HEAPSIZE\nUse to configure the size of the JVM heap which defines how much memory is allocated to your application at runtime.\n256MB by default.");  // $NLX-ManifestEnvEditorPage.APP_JVM_HEAPSIZEnUsetoconfiguret-1$
    XSPEditorUtil.createTextNoFill(container, "appJvmHeapsize", 1, 0, 6).setValidator(IntegerValidator.positiveInstance); // $NON-NLS-1$
    XSPEditorUtil.createLabel(container, "(MB)", 1).setLayoutData(gd); // $NON-NLS-1$
    
    Button btn = XSPEditorUtil.createCheckboxTF(container, "Enable full Java security permissions for code contained in NSFs", "appJavaPolicyAllPermission", 3); //  $NON-NLS-2$ $NLX-ManifestEnvEditorPage.EnablefullJavasecuritypermissions-1$
    btn.setToolTipText("APP_JAVA_POLICY_ALL_PERMISSION\nUse to enable or disable unrestricted execution of Java code in your application.\nDisabled by default."); // $NLX-ManifestEnvEditorPage.APP_JAVA_POLICY_ALL_PERMISSIONnUs-1$
    
    btn = XSPEditorUtil.createCheckboxTF(container, "Redirect to SSL", "appRedirectToSSL", 3); // $NON-NLS-2$ $NLX-ManifestEnvEditorPage.RedirecttoSSL-1$
    btn.setToolTipText("APP_REDIRECT_TO_SSL\nWhen enabled, application requests are always processed using HTTPS protocol. When disabled, regular HTTP protocol\nis normally used but programmatic switching to HTTPS protocol is still possible for specific requests.\nEnabled by default. "); // $NLX-ManifestEnvEditorPage.APP_REDIRECT_TO_SSLnWhenenabled-1$

    section.setClient(container);        
}
 
Example 12
Source File: SWTRadioButtonListWidget.java    From atdl4j with MIT License 4 votes vote down vote up
public Widget createWidget(Composite parent, int style)
{
	String tooltip = getTooltip();
	GridData controlGD = new GridData( SWT.FILL, SWT.FILL, false, false );
	
	// label
	if ( control.getLabel() != null ) {
		label = new Label( parent, SWT.NONE );
		label.setText( control.getLabel() );
		if ( tooltip != null ) label.setToolTipText( tooltip );
		controlGD.horizontalSpan = 1;
	} else {
		controlGD.horizontalSpan = 2;
	}
	
	Composite c = new Composite( parent, SWT.NONE );
	c.setLayoutData(controlGD);

	if ( ((RadioButtonListT) control).getOrientation() != null &&
		 PanelOrientationT.VERTICAL.equals( ((RadioButtonListT) control).getOrientation() ) )
	{
		c.setLayout( new GridLayout( 1, false ) );
	} else {
		RowLayout rl = new RowLayout();
		rl.wrap = false;
		c.setLayout( rl );
	}

	// radioButton
	for ( ListItemT listItem : ( (RadioButtonListT) control ).getListItem() )
	{

		Button radioElement = new Button( c, style | SWT.RADIO );
		radioElement.setText( listItem.getUiRep() );
		if ( parameter != null )
		{
			for ( EnumPairT enumPair : parameter.getEnumPair() )
			{
				if ( enumPair.getEnumID() == listItem.getEnumID() )
				{
					radioElement.setToolTipText( enumPair.getDescription() );
					break;
				}
			}
		}
		else
			radioElement.setToolTipText( tooltip );
		buttons.add( radioElement );
	}

	// set initValue (Note that this has to be the enumID, not the
	// wireValue)
	// set initValue
	if ( ControlHelper.getInitValue( control, getAtdl4jOptions() ) != null )
		setValue( (String) ControlHelper.getInitValue( control, getAtdl4jOptions() ), true );

	return c;
}
 
Example 13
Source File: ManifestEditorPage.java    From XPagesExtensionLibrary with Apache License 2.0 4 votes vote down vote up
private void createStagingArea(Composite parent) {
    Section section = XSPEditorUtil.createSection(_toolkit, parent, "Staging Settings", 1, 1); // $NLX-ManifestEditorPage.StagingSettings-1$
    Composite container = XSPEditorUtil.createSectionChild(section, 3);

    // For de-indenting (MB) labels
    // Normal spacing is 20 so reduce to 5
    GridData gd = new GridData();
    gd.horizontalIndent = -15;
    
    Label tLabel = XSPEditorUtil.createLabel(container, "Application name:", 1); // $NLX-ManifestEditorPage.Applicationname-1$
    tLabel.setToolTipText(BluemixUtil.productizeString("The %BM_PRODUCT% application name.")); // $NLX-ManifestEditorPage.TheIBMBluemixapplicationname-1$
    XSPEditorUtil.createText(container, "appName", 2, 0, 2); // $NON-NLS-1$
    
    tLabel = XSPEditorUtil.createLabel(container, "Instances:", 1); // $NLX-ManifestEditorPage.Instances-1$
    tLabel.setToolTipText("Number of instances."); // $NLX-ManifestEditorPage.Numberofinstances-1$
    XSPEditorUtil.createTextNoFill(container, "instances", 2, 0, 6).setValidator(IntegerValidator.positiveInstance); // $NON-NLS-1$

    tLabel = XSPEditorUtil.createLabel(container, "Memory:", 1); // $NLX-ManifestEditorPage.Memory-1$
    tLabel.setToolTipText("Memory for each instance."); // $NLX-ManifestEditorPage.Memoryforeachinstance-1$
    XSPEditorUtil.createTextNoFill(container, "memory", 1, 0, 6).setValidator(IntegerValidator.positiveInstance); // $NON-NLS-1$
    XSPEditorUtil.createLabel(container, "(MB)", 1).setLayoutData(gd); // $NON-NLS-1$

    tLabel = XSPEditorUtil.createLabel(container, "Disk quota:", 1); // $NLX-ManifestEditorPage.Diskquota-1$
    tLabel.setToolTipText("Disk quota for each instance."); // $NLX-ManifestEditorPage.Diskquotaforeachinstance-1$
    XSPEditorUtil.createTextNoFill(container, "diskQuota", 1, 0, 6).setValidator(IntegerValidator.positiveInstance); // $NON-NLS-1$
    XSPEditorUtil.createLabel(container, "(MB)", 1).setLayoutData(gd); // $NON-NLS-1$
    
    tLabel = XSPEditorUtil.createLabel(container, "Build pack:", 1); // $NLX-ManifestEditorPage.Buildpack-1$
    tLabel.setToolTipText("Build pack for the application."); // $NLX-ManifestEditorPage.Buildpackfortheapplication-1$
    DCComboBox bpCombo = XSPEditorUtil.createDCCombo(container, "buildPack", 2, false, false); // $NON-NLS-1$
    bpCombo.setLookup(new BasicLookup(new String[]{"xpages_buildpack"})); // $NON-NLS-1$
    bpCombo.setEditableLabels(true);      
    
    tLabel = XSPEditorUtil.createLabel(container, "Command:", 1); // $NLX-ManifestEditorPage.Command-1$
    tLabel.setToolTipText("Launch command for the application."); // $NLX-ManifestEditorPage.Launchcommandfortheapplication-1$
    DCComboBox cmdCombo = XSPEditorUtil.createDCCombo(container, "command", 2, false, false); // $NON-NLS-1$
    cmdCombo.setLookup(new BasicLookup(new String[]{"/app/launch_xpages_webcontainer"})); // $NON-NLS-1$
    bpCombo.setEditableLabels(true);

    tLabel = XSPEditorUtil.createLabel(container, "Timeout:", 1); // $NLX-ManifestEditorPage.Timeout-1$
    tLabel.setToolTipText("Use the timeout attribute to give your application more time to start."); // $NLX-ManifestEditorPage.Usethetimeoutattributetogiveyoura-1$
    XSPEditorUtil.createTextNoFill(container, "timeout", 1, 0, 6).setValidator(IntegerValidator.positiveInstance); // $NON-NLS-1$
    XSPEditorUtil.createLabel(container, "(seconds)", 1).setLayoutData(gd); // $NLX-ManifestEditorPage.seconds-1$

    tLabel = XSPEditorUtil.createLabel(container, "Path:", 1); // $NLX-ManifestEditorPage.Path-1$
    tLabel.setToolTipText(BluemixUtil.productizeString("Use the path attribute to tell %BM_PRODUCT% where to find your application.")); // $NLX-ManifestEditorPage.UsethepathattributetotellIBMBluemixw-1$
    XSPEditorUtil.createText(container, "path", 2, 0, 1); // $NON-NLS-1$
    
    tLabel = XSPEditorUtil.createLabel(container, "Stack:", 1); // $NLX-ManifestEditorPage.Stack-1$
    tLabel.setToolTipText("Use the stack attribute to specify an alternative root filesystem (rootfs) for your application."); // $NLX-ManifestEditorPage.Usethestackattributetospecifyanal-1$
    XSPEditorUtil.createText(container, "stack", 2, 0, 1); // $NON-NLS-1$

    section.setClient(container);        
}
 
Example 14
Source File: TransDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
private void addMonitoringTab() {
  // ////////////////////////
  // START OF MONITORING TAB///
  // /
  wMonitorTab = new CTabItem( wTabFolder, SWT.NONE );
  wMonitorTab.setText( BaseMessages.getString( PKG, "TransDialog.MonitorTab.Label" ) );

  Composite wMonitorComp = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wMonitorComp );

  FormLayout monitorLayout = new FormLayout();
  monitorLayout.marginWidth = Const.FORM_MARGIN;
  monitorLayout.marginHeight = Const.FORM_MARGIN;
  wMonitorComp.setLayout( monitorLayout );

  //
  // Enable step performance monitoring?
  //
  Label wlEnableStepPerfMonitor = new Label( wMonitorComp, SWT.LEFT );
  wlEnableStepPerfMonitor.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMonitoring.Label" ) );
  props.setLook( wlEnableStepPerfMonitor );
  FormData fdlSchemaName = new FormData();
  fdlSchemaName.left = new FormAttachment( 0, 0 );
  fdlSchemaName.right = new FormAttachment( middle, -margin );
  fdlSchemaName.top = new FormAttachment( 0, 0 );
  wlEnableStepPerfMonitor.setLayoutData( fdlSchemaName );
  wEnableStepPerfMonitor = new Button( wMonitorComp, SWT.CHECK );
  props.setLook( wEnableStepPerfMonitor );
  FormData fdEnableStepPerfMonitor = new FormData();
  fdEnableStepPerfMonitor.left = new FormAttachment( middle, 0 );
  fdEnableStepPerfMonitor.right = new FormAttachment( 100, 0 );
  fdEnableStepPerfMonitor.top = new FormAttachment( 0, 0 );
  wEnableStepPerfMonitor.setLayoutData( fdEnableStepPerfMonitor );
  wEnableStepPerfMonitor.addSelectionListener( lsModSel );
  wEnableStepPerfMonitor.addSelectionListener( new SelectionAdapter() {
    public void widgetSelected( SelectionEvent selectionEvent ) {
      setFlags();
    }
  } );

  //
  // Step performance interval
  //
  Label wlStepPerfInterval = new Label( wMonitorComp, SWT.LEFT );
  wlStepPerfInterval.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceInterval.Label" ) );
  props.setLook( wlStepPerfInterval );
  FormData fdlStepPerfInterval = new FormData();
  fdlStepPerfInterval.left = new FormAttachment( 0, 0 );
  fdlStepPerfInterval.right = new FormAttachment( middle, -margin );
  fdlStepPerfInterval.top = new FormAttachment( wEnableStepPerfMonitor, margin );
  wlStepPerfInterval.setLayoutData( fdlStepPerfInterval );
  wStepPerfInterval = new Text( wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  props.setLook( wStepPerfInterval );
  FormData fdStepPerfInterval = new FormData();
  fdStepPerfInterval.left = new FormAttachment( middle, 0 );
  fdStepPerfInterval.right = new FormAttachment( 100, 0 );
  fdStepPerfInterval.top = new FormAttachment( wEnableStepPerfMonitor, margin );
  wStepPerfInterval.setLayoutData( fdStepPerfInterval );
  wStepPerfInterval.addModifyListener( lsMod );

  //
  // Step performance interval
  //
  Label wlStepPerfMaxSize = new Label( wMonitorComp, SWT.LEFT );
  wlStepPerfMaxSize.setText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Label" ) );
  wlStepPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Tooltip" ) );
  props.setLook( wlStepPerfMaxSize );
  FormData fdlStepPerfMaxSize = new FormData();
  fdlStepPerfMaxSize.left = new FormAttachment( 0, 0 );
  fdlStepPerfMaxSize.right = new FormAttachment( middle, -margin );
  fdlStepPerfMaxSize.top = new FormAttachment( wStepPerfInterval, margin );
  wlStepPerfMaxSize.setLayoutData( fdlStepPerfMaxSize );
  wStepPerfMaxSize = new TextVar( transMeta, wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  wStepPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "TransDialog.StepPerformanceMaxSize.Tooltip" ) );
  props.setLook( wStepPerfMaxSize );
  FormData fdStepPerfMaxSize = new FormData();
  fdStepPerfMaxSize.left = new FormAttachment( middle, 0 );
  fdStepPerfMaxSize.right = new FormAttachment( 100, 0 );
  fdStepPerfMaxSize.top = new FormAttachment( wStepPerfInterval, margin );
  wStepPerfMaxSize.setLayoutData( fdStepPerfMaxSize );
  wStepPerfMaxSize.addModifyListener( lsMod );

  FormData fdMonitorComp = new FormData();
  fdMonitorComp.left = new FormAttachment( 0, 0 );
  fdMonitorComp.top = new FormAttachment( 0, 0 );
  fdMonitorComp.right = new FormAttachment( 100, 0 );
  fdMonitorComp.bottom = new FormAttachment( 100, 0 );
  wMonitorComp.setLayoutData( fdMonitorComp );

  wMonitorComp.layout();
  wMonitorTab.setControl( wMonitorComp );

  // ///////////////////////////////////////////////////////////
  // / END OF MONITORING TAB
  // ///////////////////////////////////////////////////////////

}
 
Example 15
Source File: ManifestHybridEditorPage.java    From XPagesExtensionLibrary with Apache License 2.0 4 votes vote down vote up
private void createRuntimeApplicationContainerArea(Composite parent) {
    Section section = XSPEditorUtil.createSection(_toolkit, parent, "Runtime Application Container", 1, 1); // $NLX-ManifestHybridEditorPage.RuntimeApplicationContainer-1$
    Composite container = XSPEditorUtil.createSectionChild(section, 2);
    
    Label tLabel = XSPEditorUtil.createLabel(container, "Server name:", 1); // $NLX-ManifestHybridEditorPage.Servername.1-1$
    tLabel.setToolTipText("Domino abbreviated server name (e.g. crm/acme)"); // $NLX-ManifestHybridEditorPage.Dominoabbreviatedservernameegcrma.1-1$
    XSPEditorUtil.createText(container, "appRuntimeServerName", 1, 0, 1); // $NON-NLS-1$

    tLabel = XSPEditorUtil.createLabel(container, "Server ID file:", 1); // $NLX-ManifestHybridEditorPage.ServerIDfile-1$
    tLabel.setToolTipText("Server ID file to be used during application staging"); // $NLX-ManifestHybridEditorPage.ServerIDfiletobeusedduringapplica-1$
   
    Composite btnContainer = new Composite(container, SWT.NONE);
    GridLayout gl = SWTLayoutUtils.createLayoutNoMarginDefaultSpacing(2);
    gl.horizontalSpacing = 5;
    btnContainer.setLayout(gl);
    btnContainer.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
    btnContainer.setBackground(getDisplay().getSystemColor(SWT.COLOR_LIST_BACKGROUND));
    
    _runtimeServerIdText = XSPEditorUtil.createText(btnContainer, "appRuntimeServerIdfile", 1, 0, 1); // $NON-NLS-1$
    Button btn = new Button(btnContainer, SWT.PUSH);
    btn.setText("Browse...");  // $NLX-ManifestHybridEditorPage.Browse-1$
    btn.addSelectionListener(new SelectionAdapter() {
        public void widgetSelected(SelectionEvent e) {
            String fileName = new Path(_deployDir).addTrailingSeparator().append(WizardUtils.getTextValue(_runtimeServerIdText, "")).toOSString();
            String fileTypes[] = new String[]{"ID files","All files"}; // $NLX-ManifestHybridEditorPage.IDfiles-1$ $NLX-ManifestHybridEditorPage.Allfiles-2$
            fileName = BluemixUtil.launchChooseFileDialog(fileName, new String[]{"*.id","*.*"}, fileTypes);  // $NON-NLS-1$  
            if (StringUtil.isNotEmpty(fileName)) {
                if (canOverwriteDeployFile(fileName)) {
                    if(copyDeployFile(fileName)) {
                        _runtimeServerIdText.setText(new File(fileName).getName());
                    }
                }
            }            
        }
    });

    tLabel = XSPEditorUtil.createLabel(container, "Server ID password:", 1); // $NLX-ManifestHybridEditorPage.ServerIDpassword-1$
    tLabel.setToolTipText("Optional Server ID file password to be used during application staging"); // $NLX-ManifestHybridEditorPage.OptionalServerIDfilepasswordtobeu-1$
    XSPEditorUtil.createPasswordText(container, "appRuntimeServerPassword", 1, 0, 1); // $NON-NLS-1$

    section.setClient(container);        
}
 
Example 16
Source File: SeriesXSheetImpl.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private void createPieAxisArea( Composite parent )
{
	lblMinSlice = new Label( parent, SWT.NONE );
	{
		lblMinSlice.setText( Messages.getString( "PieBottomAreaComponent.Label.MinimumSlice" ) ); //$NON-NLS-1$
		lblMinSlice.setToolTipText( TOOLTIP_MINIMUM_SLICE );
	}

	Composite cmpMinSlice = new Composite( parent, SWT.NONE );
	{
		GridLayout gridLayout = new GridLayout( 4, false );
		gridLayout.marginWidth = 0;
		gridLayout.marginHeight = 0;
		gridLayout.horizontalSpacing = 8;
		cmpMinSlice.setLayout( gridLayout );
		cmpMinSlice.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	}

	cmbMinSlice = getContext( ).getUIFactory( )
			.createChartCombo( cmpMinSlice,
					SWT.DROP_DOWN | SWT.READ_ONLY,
					getChart( ),
					"minSlicePercent", //$NON-NLS-1$
					Messages.getString( "PieBottomAreaComponent.Label.Percentage" ) ); //$NON-NLS-1$
	{
		cmbMinSlice.setToolTipText( TOOLTIP_MINIMUM_SLICE );
		cmbMinSlice.setItems( MINMUM_SLICE_ITEMS );
		cmbMinSlice.setItemData( MINMUM_SLICE_ITEMS );
		cmbMinSlice.setSelection( ( (ChartWithoutAxes) getChart( ) ).isMinSlicePercent( ) ? Messages.getString( "PieBottomAreaComponent.Label.Percentage" )//$NON-NLS-1$
				: Messages.getString( "PieBottomAreaComponent.Label.Value" ) );//$NON-NLS-1$
		cmbMinSlice.addSelectionListener( this );
		cmbMinSlice.addScreenReaderAccessibility( lblMinSlice.getText( ) );
	}

	txtMinSlice = getContext( ).getUIFactory( ).createChartNumberEditor( cmpMinSlice,
			SWT.BORDER,
			"%", //$NON-NLS-1$
			getChart( ),
			"minSlice" );//$NON-NLS-1$
	new TextNumberEditorAssistField( txtMinSlice.getTextControl( ), null );
	{
		GridData gridData = new GridData( GridData.FILL_HORIZONTAL );
		gridData.horizontalSpan = 3;
		txtMinSlice.setLayoutData( gridData );
		txtMinSlice.setToolTipText( TOOLTIP_MINIMUM_SLICE );
		txtMinSlice.setValue( ( (ChartWithoutAxes) getChart( ) ).getMinSlice( ) );
		txtMinSlice.addModifyListener( this );
	}

	lblBottomPercent = txtMinSlice.getUnitLabel( );
	
	lblBottomPercent.setVisible( ( (ChartWithoutAxes) getChart( ) ).isMinSlicePercent( ) );
	
	lblLabel = new Label( parent, SWT.NONE );
	{
		lblLabel.setText( Messages.getString( "PieBottomAreaComponent.Label.MinSliceLabel" ) ); //$NON-NLS-1$
		lblLabel.setToolTipText( TOOLTIP_MINIMUM_SLICE );
	}

	List<String> keys = null;
	if ( getContext( ).getUIServiceProvider( ) != null )
	{
		keys = getContext( ).getUIServiceProvider( ).getRegisteredKeys( );
	}
	txtLabel = new ExternalizedTextEditorComposite( parent,
			SWT.BORDER,
			-1,
			-1,
			keys,
			getContext( ).getUIServiceProvider( ),
			( (ChartWithoutAxes) getChart( ) ).getMinSliceLabel( ) != null
					? ( (ChartWithoutAxes) getChart( ) ).getMinSliceLabel( )
					: "" ); //$NON-NLS-1$
	{
		GridData gdTXTTitle = new GridData( GridData.FILL_HORIZONTAL );
		txtLabel.setLayoutData( gdTXTTitle );
		txtLabel.setEnabled( ( (ChartWithoutAxes) getChart( ) ).isSetMinSlice( )
				&& ( (ChartWithoutAxes) getChart( ) ).getMinSlice( ) != 0 );
		txtLabel.addListener( this );
	}
}
 
Example 17
Source File: LabelTextVar.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
public LabelTextVar( VariableSpace space, Composite composite, int flags, String labelText, String toolTipText,
    boolean passwordField ) {
  super( composite, SWT.NONE );
  props.setLook( this );

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

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;

  this.setLayout( formLayout );

  int textFlags = SWT.SINGLE | SWT.LEFT | SWT.BORDER;
  if ( flags != SWT.NONE ) {
    textFlags = flags;
  }

  if ( passwordField ) {
    wText = new PasswordTextVar( space, this, textFlags, toolTipText );
  } else {
    wText = new TextVar( space, this, textFlags, toolTipText );
  }
  FormData fdText = new FormData();
  fdText.left = new FormAttachment( middle, margin );
  fdText.right = new FormAttachment( 100, 0 );
  wText.setLayoutData( fdText );
  wText.getTextWidget().setToolTipText( toolTipText );

  wLabel = new Label( this, SWT.RIGHT );
  props.setLook( wLabel );
  wLabel.setText( labelText );
  FormData fdLabel = new FormData();
  fdLabel.left = new FormAttachment( 0, 0 );
  fdLabel.right = new FormAttachment( middle, 0 );
  fdLabel.top = new FormAttachment( wText, 0, SWT.CENTER );
  wLabel.setLayoutData( fdLabel );
  wLabel.setToolTipText( toolTipText );
}
 
Example 18
Source File: TransExecutionConfigurationDialog.java    From pentaho-kettle with Apache License 2.0 4 votes vote down vote up
protected void optionsSectionControls() {
  wClearLog = new Button( gDetails, SWT.CHECK );
  wClearLog.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Label" ) );
  wClearLog.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.ClearLog.Tooltip" ) );
  props.setLook( wClearLog );
  FormData fdClearLog = new FormData();
  fdClearLog.top = new FormAttachment( 0, 10 );
  fdClearLog.left = new FormAttachment( 0, 10 );
  wClearLog.setLayoutData( fdClearLog );

  wSafeMode = new Button( gDetails, SWT.CHECK );
  wSafeMode.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.SafeMode.Label" ) );
  wSafeMode.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.SafeMode.Tooltip" ) );
  props.setLook( wSafeMode );
  FormData fdSafeMode = new FormData();
  fdSafeMode.top = new FormAttachment( wClearLog, 7 );
  fdSafeMode.left = new FormAttachment( 0, 10 );
  wSafeMode.setLayoutData( fdSafeMode );

  wGatherMetrics = new Button( gDetails, SWT.CHECK );
  wGatherMetrics.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.GatherMetrics.Label" ) );
  wGatherMetrics.setToolTipText( BaseMessages.getString( PKG,
      "TransExecutionConfigurationDialog.GatherMetrics.Tooltip" ) );
  props.setLook( wGatherMetrics );
  FormData fdGatherMetrics = new FormData();
  fdGatherMetrics.top = new FormAttachment( wSafeMode, 7 );
  fdGatherMetrics.left = new FormAttachment( 0, 10 );
  fdGatherMetrics.bottom = new FormAttachment( 100, -10 );
  wGatherMetrics.setLayoutData( fdGatherMetrics );

  wlLogLevel = new Label( gDetails, SWT.NONE );
  props.setLook( wlLogLevel );
  wlLogLevel.setText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.LogLevel.Label" ) );
  wlLogLevel.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.LogLevel.Tooltip" ) );
  FormData fdlLogLevel = new FormData();
  fdlLogLevel.top = new FormAttachment( 0, 10 );
  fdlLogLevel.left = new FormAttachment( 45, 0 );
  wlLogLevel.setLayoutData( fdlLogLevel );

  wLogLevel = new CCombo( gDetails, SWT.READ_ONLY | SWT.BORDER );
  wLogLevel.setToolTipText( BaseMessages.getString( PKG, "TransExecutionConfigurationDialog.LogLevel.Tooltip" ) );
  props.setLook( wLogLevel );
  FormData fdLogLevel = new FormData();
  fdLogLevel.top = new FormAttachment( wlLogLevel, -2, SWT.TOP );
  fdLogLevel.width = 180;
  fdLogLevel.left = new FormAttachment( wlLogLevel, 6 );
  wLogLevel.setLayoutData( fdLogLevel );
  wLogLevel.setItems( LogLevel.getLogLevelDescriptions() );
}
 
Example 19
Source File: TextVarButton.java    From hop with Apache License 2.0 4 votes vote down vote up
protected void initialize( IVariables variables, Composite composite, int flags, String toolTipText,
                           IGetCaretPosition getCaretPositionInterface, IInsertText insertTextInterface,
                           SelectionListener selectionListener ) {
  this.toolTipText = toolTipText;
  this.getCaretPositionInterface = getCaretPositionInterface;
  this.insertTextInterface = insertTextInterface;
  this.variables = variables;

  PropsUi.getInstance().setLook( this );

  FormLayout formLayout = new FormLayout();
  formLayout.marginWidth = 0;
  formLayout.marginHeight = 0;
  formLayout.marginTop = 0;
  formLayout.marginBottom = 0;
  this.setLayout( formLayout );

  Button button = new Button( this, SWT.PUSH );
  PropsUi.getInstance().setLook( button );
  button.setText( "..." );
  FormData fdButton = new FormData();
  fdButton.top = new FormAttachment( 0, 0 );
  fdButton.right = new FormAttachment( 100, 0 );
  fdButton.bottom = new FormAttachment( 100 );
  fdButton.width = 30;
  button.setLayoutData( fdButton );
  if ( selectionListener != null ) {
    button.addSelectionListener( selectionListener );
  }

  // Add the variable $ image on the top right of the control
  //
  Label wlImage = new Label( this, SWT.NONE );
  wlImage.setImage( GuiResource.getInstance().getImageVariable() );
  wlImage.setToolTipText( BaseMessages.getString( PKG, "TextVar.tooltip.InsertVariable" ) );
  FormData fdlImage = new FormData();
  fdlImage.top = new FormAttachment( 0, 0 );
  fdlImage.right = new FormAttachment( button, 0 );
  wlImage.setLayoutData( fdlImage );

  // add a text field on it...
  wText = new Text( this, flags );
  FormData fdText = new FormData();
  fdText.top = new FormAttachment( 0, 0 );
  fdText.left = new FormAttachment( 0, 0 );
  fdText.right = new FormAttachment( wlImage, 0 );
  fdText.bottom = new FormAttachment( 100, 0 );
  wText.setLayoutData( fdText );

  modifyListenerTooltipText = getModifyListenerTooltipText( wText );
  wText.addModifyListener( modifyListenerTooltipText );

  controlSpaceKeyAdapter =
    new ControlSpaceKeyAdapter( variables, wText, getCaretPositionInterface, insertTextInterface );
  wText.addKeyListener( controlSpaceKeyAdapter );

}
 
Example 20
Source File: PipelineDialog.java    From hop with Apache License 2.0 4 votes vote down vote up
private void addMonitoringTab() {
  // ////////////////////////
  // START OF MONITORING TAB///
  // /
  wMonitorTab = new CTabItem( wTabFolder, SWT.NONE );
  wMonitorTab.setText( BaseMessages.getString( PKG, "PipelineDialog.MonitorTab.Label" ) );

  Composite wMonitorComp = new Composite( wTabFolder, SWT.NONE );
  props.setLook( wMonitorComp );

  FormLayout monitorLayout = new FormLayout();
  monitorLayout.marginWidth = Const.FORM_MARGIN;
  monitorLayout.marginHeight = Const.FORM_MARGIN;
  wMonitorComp.setLayout( monitorLayout );

  //
  // Enable transform performance monitoring?
  //
  Label wlEnableTransformPerfMonitor = new Label( wMonitorComp, SWT.LEFT );
  wlEnableTransformPerfMonitor.setText( BaseMessages.getString( PKG, "PipelineDialog.TransformPerformanceMonitoring.Label" ) );
  props.setLook( wlEnableTransformPerfMonitor );
  FormData fdlSchemaName = new FormData();
  fdlSchemaName.left = new FormAttachment( 0, 0 );
  fdlSchemaName.right = new FormAttachment( middle, -margin );
  fdlSchemaName.top = new FormAttachment( 0, 0 );
  wlEnableTransformPerfMonitor.setLayoutData( fdlSchemaName );
  wEnableTransformPerfMonitor = new Button( wMonitorComp, SWT.CHECK );
  props.setLook( wEnableTransformPerfMonitor );
  FormData fdEnableTransformPerfMonitor = new FormData();
  fdEnableTransformPerfMonitor.left = new FormAttachment( middle, 0 );
  fdEnableTransformPerfMonitor.right = new FormAttachment( 100, 0 );
  fdEnableTransformPerfMonitor.top = new FormAttachment( 0, 0 );
  wEnableTransformPerfMonitor.setLayoutData( fdEnableTransformPerfMonitor );
  wEnableTransformPerfMonitor.addSelectionListener( lsModSel );

  //
  // Transform performance interval
  //
  Label wlTransformPerfInterval = new Label( wMonitorComp, SWT.LEFT );
  wlTransformPerfInterval.setText( BaseMessages.getString( PKG, "PipelineDialog.TransformPerformanceInterval.Label" ) );
  props.setLook( wlTransformPerfInterval );
  FormData fdlTransformPerfInterval = new FormData();
  fdlTransformPerfInterval.left = new FormAttachment( 0, 0 );
  fdlTransformPerfInterval.right = new FormAttachment( middle, -margin );
  fdlTransformPerfInterval.top = new FormAttachment( wEnableTransformPerfMonitor, margin );
  wlTransformPerfInterval.setLayoutData( fdlTransformPerfInterval );
  wTransformPerfInterval = new Text( wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  props.setLook( wTransformPerfInterval );
  FormData fdTransformPerfInterval = new FormData();
  fdTransformPerfInterval.left = new FormAttachment( middle, 0 );
  fdTransformPerfInterval.right = new FormAttachment( 100, 0 );
  fdTransformPerfInterval.top = new FormAttachment( wEnableTransformPerfMonitor, margin );
  wTransformPerfInterval.setLayoutData( fdTransformPerfInterval );
  wTransformPerfInterval.addModifyListener( lsMod );

  //
  // Transform performance interval
  //
  Label wlTransformPerfMaxSize = new Label( wMonitorComp, SWT.LEFT );
  wlTransformPerfMaxSize.setText( BaseMessages.getString( PKG, "PipelineDialog.TransformPerformanceMaxSize.Label" ) );
  wlTransformPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "PipelineDialog.TransformPerformanceMaxSize.Tooltip" ) );
  props.setLook( wlTransformPerfMaxSize );
  FormData fdlTransformPerfMaxSize = new FormData();
  fdlTransformPerfMaxSize.left = new FormAttachment( 0, 0 );
  fdlTransformPerfMaxSize.right = new FormAttachment( middle, -margin );
  fdlTransformPerfMaxSize.top = new FormAttachment( wTransformPerfInterval, margin );
  wlTransformPerfMaxSize.setLayoutData( fdlTransformPerfMaxSize );
  wTransformPerfMaxSize = new TextVar( pipelineMeta, wMonitorComp, SWT.LEFT | SWT.BORDER | SWT.SINGLE );
  wTransformPerfMaxSize.setToolTipText( BaseMessages.getString( PKG, "PipelineDialog.TransformPerformanceMaxSize.Tooltip" ) );
  props.setLook( wTransformPerfMaxSize );
  FormData fdTransformPerfMaxSize = new FormData();
  fdTransformPerfMaxSize.left = new FormAttachment( middle, 0 );
  fdTransformPerfMaxSize.right = new FormAttachment( 100, 0 );
  fdTransformPerfMaxSize.top = new FormAttachment( wTransformPerfInterval, margin );
  wTransformPerfMaxSize.setLayoutData( fdTransformPerfMaxSize );
  wTransformPerfMaxSize.addModifyListener( lsMod );

  FormData fdMonitorComp = new FormData();
  fdMonitorComp.left = new FormAttachment( 0, 0 );
  fdMonitorComp.top = new FormAttachment( 0, 0 );
  fdMonitorComp.right = new FormAttachment( 100, 0 );
  fdMonitorComp.bottom = new FormAttachment( 100, 0 );
  wMonitorComp.setLayoutData( fdMonitorComp );

  wMonitorComp.layout();
  wMonitorTab.setControl( wMonitorComp );

  // ///////////////////////////////////////////////////////////
  // / END OF MONITORING TAB
  // ///////////////////////////////////////////////////////////

}