Java Code Examples for org.eclipse.swt.widgets.TabItem#setControl()

The following examples show how to use org.eclipse.swt.widgets.TabItem#setControl() . 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: RuleConfigurationEditDialog.java    From eclipse-cs with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createDialogArea(Composite parent) {
  Composite composite = (Composite) super.createDialogArea(parent);

  mMainTab = new TabFolder(composite, SWT.NULL);
  mMainTab.setLayoutData(new GridData(GridData.FILL_BOTH));

  Composite generalSettings = createGeneralSection();
  Composite advancedSettings = createAdvancedSection();

  TabItem mainItem = new TabItem(mMainTab, SWT.NULL);
  mainItem.setControl(generalSettings);
  mainItem.setText(Messages.RuleConfigurationEditDialog_tabGeneral);

  TabItem advancedItem = new TabItem(mMainTab, SWT.NULL);
  advancedItem.setControl(advancedSettings);
  advancedItem.setText(Messages.RuleConfigurationEditDialog_tabAdvanced);

  initialize();
  return composite;
}
 
Example 2
Source File: TabDialog.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Creates and returns the contents of the upper part of this dialog (above
 * the button bar).
 * <p>
 * The <code>TabDialog</code> overrides this framework method to create and
 * return a new <code>Composite</code> with an empty tab folder.
 * </p>
 * 
 * @param parent
 *            the parent composite to contain the dialog area
 * @return the dialog area control
 */
protected Control createDialogArea( Composite parent )
{
	Composite composite = (Composite) super.createDialogArea( parent );
	TabFolder tabFolder = new TabFolder( composite, SWT.TOP );
	tabFolder.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	addTabPages( ); // add pages
	for ( Iterator<TabPage> iterator = tabList.iterator( ); iterator.hasNext( ); )
	{
		TabPage page = iterator.next( );
		TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
		tabItem.setControl( page.createControl( tabFolder ) );
		tabItem.setText( page.getName( ) );
	}
	return composite;
}
 
Example 3
Source File: ReportConfigurationTab.java    From spotbugs with GNU Lesser General Public License v2.1 6 votes vote down vote up
public ReportConfigurationTab(TabFolder parent, FindbugsPropertyPage page, int style) {
    super(parent, style);
    this.propertyPage = page;
    setLayout(new GridLayout());

    TabItem tabDetector = new TabItem(parent, SWT.NONE);
    tabDetector.setText(getMessage("property.reportConfigurationTab"));
    tabDetector.setControl(this);
    tabDetector.setToolTipText("Configure bugs reported to the UI");

    Composite rankAndPrioGroup = new Composite(this, SWT.NONE);
    rankAndPrioGroup.setLayout(new GridLayout(2, false));

    createRankGroup(rankAndPrioGroup);
    createPriorityGroup(rankAndPrioGroup);

    createBugCategoriesGroup(rankAndPrioGroup, page.getProject());
    createBugSeverityGroup(rankAndPrioGroup);
}
 
Example 4
Source File: ModifyDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
protected final void addTabPage(String title, IModifyDialogTabPage tabPage) {
	final TabItem tabItem= new TabItem(fTabFolder, SWT.NONE);
	applyDialogFont(tabItem.getControl());
	tabItem.setText(title);
	tabItem.setData(tabPage);
	tabItem.setControl(tabPage.createContents(fTabFolder));
	fTabPages.add(tabPage);
}
 
Example 5
Source File: EditSdkDialogTabAbstract.java    From xds-ide with Eclipse Public License 1.0 5 votes vote down vote up
protected EditSdkDialogTabAbstract(TabFolder tabFolder, EditSdkDialog editSdkDialog) {
    super(tabFolder, SWT.NONE);
    this.editSdkDialog = editSdkDialog;
    tabItem = new TabItem(tabFolder, SWT.NULL);
    tabItem.setText(getTabName());
    tabItem.setControl(this);
    createTabControls();
}
 
Example 6
Source File: HadoopLocationWizard.java    From RDFS with Apache License 2.0 5 votes vote down vote up
TabAdvanced(TabMediator mediator) {
  this.mediator = mediator;
  TabItem tab = new TabItem(mediator.folder, SWT.NONE);
  tab.setText("Advanced parameters");
  tab.setToolTipText("Access to advanced Hadoop parameters");
  tab.setImage(circle);
  tab.setControl(createControl(mediator.folder));

}
 
Example 7
Source File: CronEditor.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
protected void createMinutesTab(TabFolder tablFolder) {
    final TabItem item = new TabItem(tablFolder, SWT.NONE);
    item.setText(Messages.minutes);
    final Composite minuteContent = new Composite(tablFolder, SWT.NONE);
    minuteContent.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    minuteContent.setLayout(GridLayoutFactory.fillDefaults().numColumns(3).margins(15, 10).create());

    final Label everyLabel = new Label(minuteContent, SWT.NONE);
    everyLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.END, SWT.CENTER).create());
    everyLabel.setText(Messages.every);

    final Text minuteText = new Text(minuteContent, SWT.BORDER | SWT.SINGLE);
    minuteText.setLayoutData(GridDataFactory.fillDefaults().hint(70, SWT.DEFAULT).create());

    UpdateValueStrategy strategy = new UpdateValueStrategy();
    strategy.setAfterGetValidator(dotValidator);
    strategy.setConverter(StringToNumberConverter.toInteger(true));
    strategy.setBeforeSetValidator(new FrequencyValidator());
    context.bindValue(SWTObservables.observeText(minuteText, SWT.Modify),
            PojoProperties.value("minuteFrequencyForMinute").observe(cronExpression), strategy, null);

    final Label minuteLabel = new Label(minuteContent, SWT.NONE);
    minuteLabel.setLayoutData(GridDataFactory.fillDefaults().align(SWT.BEGINNING, SWT.CENTER).create());
    minuteLabel.setText(Messages.minuteLabel);

    item.setControl(minuteContent);
    cronExpression.setMode(item.getText());
}
 
Example 8
Source File: VariableAndOptionPage.java    From M2Doc with Eclipse Public License 1.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {

    final Composite container = new Composite(parent, parent.getStyle());
    setControl(container);
    container.setLayout(new GridLayout(1, false));

    final TabFolder tabFolder = new TabFolder(container, SWT.BORDER);
    tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

    final TabItem variableTabItem = new TabItem(tabFolder, tabFolder.getStyle());
    variableTabItem.setText("Variables");
    final Composite variableContainer = new Composite(tabFolder, tabFolder.getStyle());
    variableTabItem.setControl(variableContainer);
    variablesTable = createVariablesTable(generation, variableContainer, adapterFactory,
            templateCustomPropertiesProvider);
    generationListener.setVariablesViewer(variablesTable);
    createVariablesButonComposite(generation, variableContainer, variablesTable);

    final TabItem optionTabItem = new TabItem(tabFolder, tabFolder.getStyle());
    optionTabItem.setText("Options (expert)");
    final Composite optionContainer = new Composite(tabFolder, tabFolder.getStyle());
    optionTabItem.setControl(optionContainer);
    optionContainer.setLayout(new GridLayout(2, false));
    optionsTable = createOptionsTable(generation, optionContainer);
    generationListener.setOptionsViewer(optionsTable);
    createOptionsButonComposite(generation, optionContainer, optionsTable);
    initializeGenerationVariableDefinition(generation);
}
 
Example 9
Source File: EventHistorySearchDialog.java    From neoscada with Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected Control createDialogArea ( final Composite parent )
{
    // initialize header area
    setTitle ( Messages.search_for_events );
    setMessage ( Messages.search_for_events_description );
    // setHelpAvailable ( true );

    // initialize content
    final Composite rootComposite = (Composite)super.createDialogArea ( parent );

    String filterString = ""; //$NON-NLS-1$
    if ( this.initialFilter != null && this.initialFilter.second != null )
    {
        filterString = this.initialFilter.second;
    }

    final TabFolder tabFolder = new TabFolder ( rootComposite, SWT.NONE );

    // create tabs
    for ( final FilterTab tab : getFilterTabs () )
    {
        final TabItem tabItem = new TabItem ( tabFolder, SWT.NONE );
        tabItem.setText ( tab.getName () );
        tabItem.setControl ( tab.createControl ( tabFolder, this, SWT.NONE, filterString ) );
    }

    final GridData layoutData = new GridData ();
    layoutData.horizontalAlignment = GridData.FILL;
    layoutData.grabExcessHorizontalSpace = true;
    layoutData.verticalAlignment = GridData.FILL;
    layoutData.grabExcessVerticalSpace = true;
    tabFolder.setLayoutData ( layoutData );

    selectInitialFilterPage ( tabFolder );

    return rootComposite;
}
 
Example 10
Source File: SubscriptionWizard.java    From BiglyBT with GNU General Public License v2.0 5 votes vote down vote up
private Composite createCreateComposite(Composite parent) {
	Composite composite = new Composite(parent,SWT.NONE);

	FillLayout layout = new FillLayout();
	layout.marginHeight = 8;
	layout.marginWidth  = 8;

	composite.setLayout(layout);

	createTabFolder = new TabFolder(composite,SWT.NONE);
	createTabFolder.setFont(subTitleFont);

	createSearchTabItem = new TabItem(createTabFolder,SWT.NONE);
	createSearchTabItem.setText(MessageText.getString("Wizard.Subscription.create.search"));
	createSearchTabItem.setControl(createCreateSearchComposite(createTabFolder));

	createRSSTabItem = new TabItem(createTabFolder,SWT.NONE);
	createRSSTabItem.setText("  " + MessageText.getString("Wizard.Subscription.create.rss"));
	createRSSTabItem.setControl(createCreateRSSComposite(createTabFolder));

	createTabFolder.addListener(SWT.Selection, new Listener() {
		@Override
		public void handleEvent(Event event) {
			TabItem[] selectedItems = createTabFolder.getSelection();
			if(selectedItems.length != 1) {
				return;
			}
			TabItem selectedItem = selectedItems[0];
			if(selectedItem == createRSSTabItem) {
				setMode(MODE_CREATE_RSS);
			} else {
				setMode(MODE_CREATE_SEARCH);
			}
		}
	});

	return composite;
}
 
Example 11
Source File: CleanUpSelectionDialog.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
private final void addTabPage(String title, IModifyDialogTabPage tabPage) {
	final TabItem tabItem= new TabItem(fTabFolder, SWT.NONE);
	applyDialogFont(tabItem.getControl());
	tabItem.setText(title);
	tabItem.setData(tabPage);
	tabItem.setControl(tabPage.createContents(fTabFolder));
	fTabPages.add(tabPage);
}
 
Example 12
Source File: GrammarPreferencePage.java    From tm4e with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Create "Content type" tab
 * 
 * @param folder
 */
private void createContentTypeTab(TabFolder folder) {
	TabItem tab = new TabItem(folder, SWT.NONE);
	tab.setText(TMUIMessages.GrammarPreferencePage_tab_contentType_text);

	Composite parent = new Composite(folder, SWT.NONE);
	parent.setLayout(new GridLayout());
	parent.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	contentTypesWidget = new ContentTypesBindingWidget(parent, SWT.NONE);
	contentTypesWidget.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	tab.setControl(parent);
}
 
Example 13
Source File: FormatterModifyDialog.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
private final void addTabPageNewAPI(String title, IModifyDialogTabPage tabPage) {
	final TabItem tabItem = new TabItem(fTabFolder, SWT.NONE);
	applyDialogFont(tabItem.getControl());
	tabItem.setText(title);
	tabItem.setData(tabPage);
	tabItem.setControl(tabPage.createContents(fTabFolder));
	fTabPages.add(tabPage);
}
 
Example 14
Source File: SWTNumberAxisEditor.java    From openstock with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new editor.
 * 
 * @param parent  the parent.
 * @param style  the style.
 * @param axis  the axis.
 */
public SWTNumberAxisEditor(Composite parent, int style, NumberAxis axis) {
    super(parent, style, axis);
    this.autoRange = axis.isAutoRange();
    this.minimumValue = axis.getLowerBound();
    this.maximumValue = axis.getUpperBound();

    TabItem item2 = new TabItem(getOtherTabs(), SWT.NONE);
    item2.setText(" " + localizationResources.getString("Range") + " ");
    Composite range = new Composite(getOtherTabs(), SWT.NONE);
    range.setLayout(new GridLayout(2, true));
    item2.setControl(range);
    
    this.autoRangeCheckBox = new Button(range, SWT.CHECK);
    this.autoRangeCheckBox.setText(localizationResources.getString(
            "Auto-adjust_range"));
    this.autoRangeCheckBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, 
            true, false, 2, 1));
    this.autoRangeCheckBox.setSelection(this.autoRange);
    this.autoRangeCheckBox.addSelectionListener(new SelectionAdapter() {
            public void widgetSelected(SelectionEvent e) { 
                toggleAutoRange();
            }
        });
    new Label(range, SWT.NONE).setText(localizationResources.getString(
            "Minimum_range_value"));
    this.minimumRangeValue = new Text(range, SWT.BORDER);
    this.minimumRangeValue.setText(String.valueOf(this.minimumValue));
    this.minimumRangeValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
            true, false));
    this.minimumRangeValue.setEnabled(!this.autoRange);
    //this.minimumRangeValue.addModifyListener(this);
    //this.minimumRangeValue.addVerifyListener(this);
    this.minimumRangeValue.addFocusListener(this);
    new Label(range, SWT.NONE).setText(localizationResources.getString(
            "Maximum_range_value"));
    this.maximumRangeValue = new Text(range, SWT.BORDER);
    this.maximumRangeValue.setText(String.valueOf(this.maximumValue));
    this.maximumRangeValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
            true, false));
    this.maximumRangeValue.setEnabled(!this.autoRange);
    //this.maximumRangeValue.addModifyListener(this);
    //this.maximumRangeValue.addVerifyListener(this);
    this.maximumRangeValue.addFocusListener(this);
}
 
Example 15
Source File: SWTPlotEditor.java    From buffer_bci with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new editor for the specified plot.
 *
 * @param parent  the parent.
 * @param style  the style.
 * @param plot  the plot.
 */
public SWTPlotEditor(Composite parent, int style, Plot plot) {
    super(parent, style);
    FillLayout layout = new FillLayout();
    layout.marginHeight = layout.marginWidth = 4;
    setLayout(layout);

    Group plotType = new Group(this, SWT.NONE);
    FillLayout plotTypeLayout = new FillLayout();
    plotTypeLayout.marginHeight = plotTypeLayout.marginWidth = 4;
    plotType.setLayout(plotTypeLayout);
    plotType.setText(plot.getPlotType() + localizationResources.getString(
            ":"));

    TabFolder tabs = new TabFolder(plotType, SWT.NONE);

    //deal with domain axis
    TabItem item1 = new TabItem(tabs, SWT.NONE);
    item1.setText(localizationResources.getString("Domain_Axis"));
    Axis domainAxis = null;
    if (plot instanceof CategoryPlot) {
        domainAxis = ((CategoryPlot) plot).getDomainAxis();
    }
    else if (plot instanceof XYPlot) {
        domainAxis = ((XYPlot) plot).getDomainAxis();
    }
    this.domainAxisPropertyPanel = SWTAxisEditor.getInstance(tabs,
            SWT.NONE, domainAxis);
    item1.setControl(this.domainAxisPropertyPanel);

    //deal with range axis
    TabItem item2 = new TabItem(tabs, SWT.NONE);
    item2.setText(localizationResources.getString("Range_Axis"));
    Axis rangeAxis = null;
    if (plot instanceof CategoryPlot) {
        rangeAxis = ((CategoryPlot) plot).getRangeAxis();
    }
    else if (plot instanceof XYPlot) {
        rangeAxis = ((XYPlot) plot).getRangeAxis();
    }
    this.rangeAxisPropertyPanel = SWTAxisEditor.getInstance(tabs, SWT.NONE,
            rangeAxis);
    item2.setControl(this.rangeAxisPropertyPanel);

    //deal with plot appearance
    TabItem item3 = new TabItem(tabs, SWT.NONE);
    item3.setText(localizationResources.getString("Appearance"));
    this.plotAppearance = new SWTPlotAppearanceEditor(tabs, SWT.NONE, plot);
    item3.setControl(this.plotAppearance);
}
 
Example 16
Source File: SearchDialog.java    From ermasterr with Apache License 2.0 4 votes vote down vote up
private void createResultGroup(final TabFolder tabFolder) {
    final TabItem tabItem = new TabItem(tabFolder, SWT.NONE);
    tabItem.setText(ResourceString.getResourceString("label.search.result"));

    final GridData gridData = new GridData();
    gridData.grabExcessVerticalSpace = true;
    gridData.verticalAlignment = SWT.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = SWT.FILL;

    resultTable = new Table(tabFolder, SWT.NONE | SWT.FULL_SELECTION | SWT.MULTI);
    resultTable.setHeaderVisible(true);
    resultTable.setLayoutData(gridData);
    resultTable.setLinesVisible(true);

    resultTable.addSelectionListener(new SelectionAdapter() {

        /**
         * {@inheritDoc}
         */
        @Override
        public void widgetSelected(final SelectionEvent e) {
            final int index = resultTable.getSelectionIndex();

            if (index == -1) {
                replaceButton.setEnabled(false);
                replaceCombo.setEnabled(false);

            } else {
                replaceButton.setEnabled(true);
                replaceCombo.setEnabled(true);

                final SearchResultRow searchResultRow = searchResult.getRows().get(index);

                final Object object = searchResultRow.getTargetNode();

                if (object != null) {
                    focus(object);
                }
            }
        }
    });

    final TableColumn tableColumn0 = new TableColumn(resultTable, SWT.LEFT);
    tableColumn0.setWidth(250);
    tableColumn0.setText(ResourceString.getResourceString("label.search.result.table.path"));
    tableColumn0.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_PATH));

    final TableColumn tableColumn1 = new TableColumn(resultTable, SWT.LEFT);
    tableColumn1.setWidth(100);
    tableColumn1.setText(ResourceString.getResourceString("label.search.result.table.type"));
    tableColumn1.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_TYPE));

    final TableColumn tableColumn2 = new TableColumn(resultTable, SWT.LEFT);
    tableColumn2.setWidth(200);
    tableColumn2.setText(ResourceString.getResourceString("label.search.result.table.name"));
    tableColumn2.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_NAME));

    final TableColumn tableColumn3 = new TableColumn(resultTable, SWT.LEFT);
    tableColumn3.setWidth(200);
    tableColumn3.setText(ResourceString.getResourceString("label.search.result.table.value"));
    tableColumn3.addSelectionListener(new SearchResultSortListener(SearchResult.SORT_TYPE_VALUE));

    tabItem.setControl(resultTable);
}
 
Example 17
Source File: SWTChartEditor.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Creates a new editor for the specified plot.
 *
 * @param parent
 *            the parent.
 * @param style
 *            the style.
 * @param plot
 *            the plot.
 */
public SWTPlotEditor(final Composite parent, final int style, final Plot plot) {
	super(parent, style);
	final FillLayout layout = new FillLayout();
	layout.marginHeight = layout.marginWidth = 4;
	setLayout(layout);

	final Group plotType = new Group(this, SWT.NONE);
	final FillLayout plotTypeLayout = new FillLayout();
	plotTypeLayout.marginHeight = plotTypeLayout.marginWidth = 4;
	plotType.setLayout(plotTypeLayout);
	plotType.setText(plot.getPlotType() + ":");

	final TabFolder tabs = new TabFolder(plotType, SWT.NONE);

	// deal with domain axis
	final TabItem item1 = new TabItem(tabs, SWT.NONE);
	item1.setText("Domain Axis");
	Axis domainAxis = null;
	if (plot instanceof CategoryPlot) {
		domainAxis = ((CategoryPlot) plot).getDomainAxis();
	} else if (plot instanceof XYPlot) {
		domainAxis = ((XYPlot) plot).getDomainAxis();
	}
	this.domainAxisPropertyPanel = SWTAxisEditor.getInstance(tabs, SWT.NONE, domainAxis);
	item1.setControl(this.domainAxisPropertyPanel);

	// deal with range axis
	final TabItem item2 = new TabItem(tabs, SWT.NONE);
	item2.setText("Range Axis");
	Axis rangeAxis = null;
	if (plot instanceof CategoryPlot) {
		rangeAxis = ((CategoryPlot) plot).getRangeAxis();
	} else if (plot instanceof XYPlot) {
		rangeAxis = ((XYPlot) plot).getRangeAxis();
	}
	this.rangeAxisPropertyPanel = SWTAxisEditor.getInstance(tabs, SWT.NONE, rangeAxis);
	item2.setControl(this.rangeAxisPropertyPanel);

	// deal with plot appearance
	final TabItem item3 = new TabItem(tabs, SWT.NONE);
	item3.setText("Appearance");
	this.plotAppearance = new SWTPlotAppearanceEditor(tabs, SWT.NONE, plot);
	item3.setControl(this.plotAppearance);
}
 
Example 18
Source File: TransitionTest1.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
@Override
public void init() {
    
    _containerComposite.setLayout(new FillLayout());
    
    tf = new TabFolder(_containerComposite, SWT.NONE);
    
    TabItem tbi1 = new TabItem(tf, SWT.NONE);
    tbi1.setText("Tab Item 1");
    tbi1.setControl(getComp1(tf));
    
    TabItem tbi2 = new TabItem(tf, SWT.NONE);
    tbi2.setText("Tab Item 2");
    tbi2.setControl(getComp2(tf));
    
    TabItem tbi3 = new TabItem(tf, SWT.NONE);
    tbi3.setText("Tab Item 3");
    tbi3.setControl(getComp3(tf));
    
    _tm = new TransitionManager(new Transitionable(){
        public void addSelectionListener(SelectionListener listener) {
            tf.addSelectionListener(listener);
        }
        
        public Control getControl(int index) {
            return tf.getItem(index).getControl();
        }
        
        public Composite getComposite() {
            return tf;
        }

        public int getSelection() {
            return tf.getSelectionIndex();
        }
        
        public void setSelection(int index) {
            tf.setSelection(index);
        }
        
        public double getDirection(int toIndex, int fromIndex) {
            return getSelectedDirection(toIndex, fromIndex);
        }
        
    });
    
}
 
Example 19
Source File: SWTNumberAxisEditor.java    From astor with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Creates a new editor.
 * 
 * @param parent  the parent.
 * @param style  the style.
 * @param axis  the axis.
 */
public SWTNumberAxisEditor(Composite parent, int style, NumberAxis axis) {
    super(parent, style, axis);
    this.autoRange = axis.isAutoRange();
    this.minimumValue = axis.getLowerBound();
    this.maximumValue = axis.getUpperBound();

    TabItem item2 = new TabItem(getOtherTabs(), SWT.NONE);
    item2.setText(" " + localizationResources.getString("Range") + " ");
    Composite range = new Composite(getOtherTabs(), SWT.NONE);
    range.setLayout(new GridLayout(2, true));
    item2.setControl(range);
    
    this.autoRangeCheckBox = new Button(range, SWT.CHECK);
    this.autoRangeCheckBox.setText(localizationResources.getString(
            "Auto-adjust_range"));
    this.autoRangeCheckBox.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, 
            true, false, 2, 1));
    this.autoRangeCheckBox.setSelection(this.autoRange);
    this.autoRangeCheckBox.addSelectionListener( 
            new SelectionAdapter() {
                public void widgetSelected(SelectionEvent e) { 
                    toggleAutoRange();
                }
            });
    new Label(range, SWT.NONE).setText(localizationResources.getString(
            "Minimum_range_value"));
    this.minimumRangeValue = new Text(range, SWT.BORDER);
    this.minimumRangeValue.setText(String.valueOf(this.minimumValue));
    this.minimumRangeValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
            true, false));
    this.minimumRangeValue.setEnabled(!this.autoRange);
    //this.minimumRangeValue.addModifyListener(this);
    //this.minimumRangeValue.addVerifyListener(this);
    this.minimumRangeValue.addFocusListener(this);
    new Label(range, SWT.NONE).setText(localizationResources.getString(
            "Maximum_range_value"));
    this.maximumRangeValue = new Text(range, SWT.BORDER);
    this.maximumRangeValue.setText(String.valueOf(this.maximumValue));
    this.maximumRangeValue.setLayoutData(new GridData(SWT.FILL, SWT.CENTER,
            true, false));
    this.maximumRangeValue.setEnabled(!this.autoRange);
    //this.maximumRangeValue.addModifyListener(this);
    //this.maximumRangeValue.addVerifyListener(this);
    this.maximumRangeValue.addFocusListener(this);
}
 
Example 20
Source File: ValidatableTabWrapper.java    From ermasterr with Apache License 2.0 3 votes vote down vote up
public ValidatableTabWrapper(final AbstractTabbedDialog dialog, final TabFolder parent, final String title) {
    super(parent, SWT.NONE);

    this.dialog = dialog;

    tabItem = new TabItem(parent, SWT.NONE);
    tabItem.setText(ResourceString.getResourceString(title));

    tabItem.setControl(this);
}