org.eclipse.swt.widgets.TabItem Java Examples

The following examples show how to use org.eclipse.swt.widgets.TabItem. 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: AbstractRealColumnDialog.java    From ermaster-b with Apache License 2.0 7 votes vote down vote up
@Override
protected Composite createRootComposite(Composite parent) {
	this.tabFolder = new TabFolder(parent, SWT.NONE);

	this.tabItem = new TabItem(this.tabFolder, SWT.NONE);
	this.tabItem.setText(ResourceString.getResourceString("label.basic"));

	Composite composite = super.createRootComposite(this.tabFolder);
	this.tabItem.setControl(composite);

	this.tabItem = new TabItem(this.tabFolder, SWT.NONE);
	this.tabItem.setText(ResourceString.getResourceString("label.detail"));

	Composite detailComposite = this.createDetailTab(this.tabFolder);
	this.initializeDetailTab(detailComposite);
	this.tabItem.setControl(detailComposite);

	return composite;
}
 
Example #2
Source File: LogViewer.java    From LogViewer with Eclipse Public License 2.0 6 votes vote down vote up
public void widgetSelected(SelectionEvent e) {
    TabItem item = (TabItem)e.item;
    if(item == null) {
        return;
    }
    // get new
    LogFileTab tab = getSelectedTab(item);
    if(tab == null || tab.getDocument() == null) {
        return;
    }
    // save old selection
    if (oldTabItem != null) {
        LogFileTab oldTab = getSelectedTab(oldTabItem);
        if((oldTab != null) && (oldTab.getDocument() != null)) {
            oldTab.setSelection(viewer.getSelection());
            oldTab.setTopIndex(viewer.getTopIndex());
        }
    }
    // restore
    fileEncodingAction.setText(LogViewerPlugin.getResourceString("menu.encodingchange.text",new Object[] {tab.getDocument().getEncoding()})); //$NON-NLS-1$
    showDocument(tab.getDocument(), tab.getSelection(), tab.getTopIndex(),false);
    updateTailStartStopButtons(tab.getDocument().isMonitor());
    refreshCurrentFileAction.setEnabled(true);
    // set act tab item
    oldTabItem = item;
}
 
Example #3
Source File: POJOClassTabFolderPage.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
public TabItem createContents( TabFolder tabFolder )
{
	final Composite page = new Composite( tabFolder, SWT.NONE );

	GridLayout layout = new GridLayout( );
	layout.numColumns = 2;
	layout.marginHeight = 10;
	layout.verticalSpacing = 5;
	page.setLayout( layout );
	page.setLayoutData( new GridData( GridData.FILL_BOTH ) );

	TabItem tabItem = new TabItem( tabFolder, SWT.NONE );
	tabItem.setControl( page );

	createComposite( page );

	return tabItem;
}
 
Example #4
Source File: AggregationDialog.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
private TabFolder createTabFolder( Composite parent )
{
	tabFolder = new TabFolder( parent, SWT.NONE );
	// Should not set layout for TabFolder.
	// GridData gd = new GridData( GridData.FILL_BOTH );
	// tabFolder.setLayoutData( gd );
	// GridLayout layout = new GridLayout( );
	// tabFolder.setLayout( layout );

	rowArea = new TabItem( tabFolder, SWT.NONE );
	rowArea.setText( Messages.getString( "AggregationDialog.TabItem.Title.RowArea" ) ); //$NON-NLS-1$
	rowArea.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.ROWS_AREA_IMAGE ) );

	columnArea = new TabItem( tabFolder, SWT.NONE );
	columnArea.setText( Messages.getString( "AggregationDialog.TabItem.Title.ColumnArea" ) ); //$NON-NLS-1$
	columnArea.setImage( CrosstabUIHelper.getImage( CrosstabUIHelper.COLUMNS_AREA_IMAGE ) );

	return tabFolder;
}
 
Example #5
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 #6
Source File: SpellPage.java    From tmxeditor8 with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Control createContents(Composite parent) {
	isInit = true;
	Composite tParent = new Composite(parent, SWT.BORDER);
	tParent.setLayoutData(new GridData(GridData.FILL_BOTH));
	tParent.setLayout(new GridLayout());
	
	addSpellInstalGroup(tParent);
	
	tabFolder = new TabFolder(tParent, SWT.NONE);
	tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	hunspellTabItem = new TabItem(tabFolder, SWT.NONE);
	hunspellTabItem.setText(Messages.getString("qa.preference.SpellPage.hunspellTab"));
	
	aspellTabItem = new TabItem(tabFolder, SWT.NONE);
	aspellTabItem.setText(Messages.getString("qa.preference.SpellPage.aspellTab"));
	
	createHunspellCmp();
	createAspellCmp();
	
	initData();
	return parent;
}
 
Example #7
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 #8
Source File: UpdaterDialog.java    From developer-studio with Apache License 2.0 6 votes vote down vote up
private void createFeatureListTab(TabFolder tabFolder, ActiveTab type) {
	TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
	if (type == ActiveTab.ALL_FEATURES) {
		tabItem.setText(ALL_FEATURES_TAB_TITLE);
	} else {
		tabItem.setText(UPDATES_TAB_TITLE);
	}
	ScrolledComposite scroll = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
	scroll.setLayout(new GridLayout());
	scroll.setLayoutData(new GridData());

	Group group = new Group(scroll, SWT.NONE);
	group.setLayout(new GridLayout());
	group.setLayoutData(new GridData());
	listFeatures(group, type);
	scroll.setContent(group);
	scroll.setExpandHorizontal(true);
	scroll.setExpandVertical(true);
	scroll.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	tabItem.setControl(scroll);
}
 
Example #9
Source File: ChangeSignatureWizard.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
private void createParameterExceptionsFolder(Composite composite) {
	TabFolder folder= new TabFolder(composite, SWT.TOP);
	folder.setLayoutData(new GridData(GridData.FILL_BOTH));

	TabItem item= new TabItem(folder, SWT.NONE);
	item.setText(RefactoringMessages.ChangeSignatureInputPage_parameters);
	item.setControl(createParameterTableControl(folder));

	TabItem itemEx= new TabItem(folder, SWT.NONE);
	itemEx.setText(RefactoringMessages.ChangeSignatureInputPage_exceptions);
	itemEx.setControl(createExceptionsTableControl(folder));

	folder.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			((TabItem) e.item).getControl().setFocus();
		}
	});
}
 
Example #10
Source File: SettingsDialog.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildPieSettings() {
	pagePieChart.setLayout(new FillLayout());
	TabFolder folderPieChart = new TabFolder(pagePieChart, SWT.NONE);
	
	TabItem itemFolderPieChart_1 = new TabItem(folderPieChart, SWT.NONE);
	itemFolderPieChart_1.setText("General Settings");
	TabItem itemFolderPieChart_2 = new TabItem(folderPieChart, SWT.NONE);
	itemFolderPieChart_2.setText("Legend Settings");
	TabItem itemFolderPieChart_3 = new TabItem(folderPieChart, SWT.NONE);
	itemFolderPieChart_3.setText("Series Settings");
	
	
	gerneralPagePie = new GeneralPagePie(folderPieChart, SWT.NONE);
	itemFolderPieChart_1.setControl(gerneralPagePie);
	legendPagePie = new LegendPagePie(folderPieChart, SWT.NONE);
	itemFolderPieChart_2.setControl(legendPagePie);
	seriesPagePie = new SeriesPagePie(folderPieChart, SWT.NONE);
	itemFolderPieChart_3.setControl(seriesPagePie);
}
 
Example #11
Source File: SettingsDialog.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildBubbleSettings() {
	pageBubbleChart.setLayout(new FillLayout());
	TabFolder folderBubbleChart = new TabFolder(pageBubbleChart, SWT.NONE);
	
	TabItem itemFolderBubbleChart_1 = new TabItem(folderBubbleChart, SWT.NONE);
	TabItem itemFolderBubbleChart_2 = new TabItem(folderBubbleChart, SWT.NONE);
	TabItem itemFolderBubbleChart_3 = new TabItem(folderBubbleChart, SWT.NONE);
	
	gerneralPageBubble = new GeneralPageBubble(folderBubbleChart, SWT.NONE);
	seriesPageBubble = new SeriesPageBubble(folderBubbleChart, SWT.NONE);
	axisPageBubble = new AxisPageBubble(folderBubbleChart, SWT.NONE);
	
	itemFolderBubbleChart_1.setControl(gerneralPageBubble);
	itemFolderBubbleChart_2.setControl(seriesPageBubble);
	itemFolderBubbleChart_3.setControl(axisPageBubble);
	
	itemFolderBubbleChart_1.setText("General Settings");
	itemFolderBubbleChart_2.setText("Series Settings");
	itemFolderBubbleChart_3.setText("Axis Settings");
}
 
Example #12
Source File: SettingsDialog.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
private void buildBarSettings() {
	
	TabFolder folderBarChart = new TabFolder(pageBarChart, SWT.NONE);
	
	TabItem itemFolderBarChart_1 = new TabItem(folderBarChart, SWT.NONE);
	TabItem itemFolderBarChart_2 = new TabItem(folderBarChart, SWT.NONE);
	TabItem itemFolderBarChart_3 = new TabItem(folderBarChart, SWT.NONE);
	TabItem itemFolderBarChart_4 = new TabItem(folderBarChart, SWT.NONE);
	
	
	generalPageBar = new GeneralPageBar(folderBarChart, SWT.NONE);
	itemFolderBarChart_1.setControl(generalPageBar);
	itemFolderBarChart_1.setText("General Settings");
	
	legendPageBar = new LegendPageBar(folderBarChart, SWT.NONE);
	itemFolderBarChart_2.setControl(legendPageBar);
	itemFolderBarChart_2.setText("Legend Settings");
	
	seriesPageBar = new SeriesPageBar(folderBarChart, SWT.NONE);
	itemFolderBarChart_3.setControl(seriesPageBar);
	itemFolderBarChart_3.setText("Series Settings");
	
	axisPageBar = new AxisPageBar(folderBarChart, SWT.NONE);
	itemFolderBarChart_4.setControl(axisPageBar);
	itemFolderBarChart_4.setText("Axis Settings");
}
 
Example #13
Source File: EditboxPreferencePage.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
public void widgetSelected(final SelectionEvent e) {
	final int i = categoryList.getSelectionIndex();
	if (i > -1) {
		final String name = categoryList.getItem(i);
		categoryList.remove(i);
		categoryFiles.remove(name);
		namesList.setItems(new String[0]);
		bAddFile.setEnabled(false);
		final TabItem ti = folder.getItem(i + 1);
		final Object o = ti.getData();
		ti.dispose();
		if (o instanceof BoxSettingsTab) {
			((BoxSettingsTab) o).dispose();
		}
		BoxProviderRegistry.getInstance().removeProvider(name);
		providersChanged = true;
	}
}
 
Example #14
Source File: EditboxPreferencePage.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
@Override
public boolean performOk() {
	final TabItem[] items = folder.getItems();
	for (int i = 1; i < items.length; i++) {
		final Object o = items[i].getData();
		if (o instanceof BoxSettingsTab) {
			final BoxSettingsTab pref = (BoxSettingsTab) o;
			final String msg = pref.validate();
			if (msg != null) {
				folder.setSelection(i);
				setMessage(msg);
				return false;
			}
			pref.save();
		}
	}
	if (providersChanged) {
		BoxProviderRegistry.getInstance().storeProviders();
	}
	return true;
}
 
Example #15
Source File: EditboxPreferencePage.java    From gama with GNU General Public License v3.0 6 votes vote down vote up
protected void newTab(final String value) {
	categoryList.add(value);
	final TabItem item = new TabItem(folder, SWT.NONE);
	item.setText(value);
	final BoxSettingsTab p = new BoxSettingsTab();
	final IBoxProvider provider = BoxProviderRegistry.getInstance().providerForName(value);
	item.setControl(p.createContro(folder, provider));
	item.setData(p);
	if (categoryFiles == null) {
		categoryFiles = new LinkedHashMap<>();
	}
	Collection<String> fileNames = p.getSettings().getFileNames();
	if (fileNames == null) {
		fileNames = Collections.emptyList();
	}
	categoryFiles.put(value, new LinkedHashSet<>(fileNames));
	categoryList.setSelection(new String[] { value });
	namesList.setItems(fileNames.toArray(new String[0]));
	bAddFile.setEnabled(true);
}
 
Example #16
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 #17
Source File: ValidatableTabWrapper.java    From erflute with Apache License 2.0 5 votes vote down vote up
public ValidatableTabWrapper(AbstractDialog dialog, TabFolder parent, int style, String title) {
    super(parent, style);
    this.dialog = dialog;
    this.tabItem = new TabItem(parent, style);
    tabItem.setText(DisplayMessages.getMessage(title));
    tabItem.setControl(this);
}
 
Example #18
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 #19
Source File: HadoopLocationWizard.java    From hadoop-gpu 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 #20
Source File: AccountTabFolder.java    From offspring with MIT License 5 votes vote down vote up
private void createTabContents(TabItem tab) {
  if (tab.equals(transactionsTab) && transactionsControl == null) {
    transactionsControl = new TransactionsControl(tabFolder, SWT.NONE,
        accountId, nxt, engine, userService, sync);
    transactionsTab.setControl(transactionsControl);
  }
  else if (tab.equals(generatedBlocksTab) && generatedBlocksControl == null) {
    generatedBlocksControl = new GeneratedBlocksControl(tabFolder, SWT.NONE,
        accountId, engine, nxt, userService, sync, contactsService);
    generatedBlocksTab.setControl(generatedBlocksControl);
  }
  else if (tab.equals(aliasesTab) && aliasesControl == null) {
    aliasesControl = new AliasControl(tabFolder, SWT.NONE, accountId, nxt,
        engine, userService, sync, contactsService);
    aliasesTab.setControl(aliasesControl);
  }
  else if (tab.equals(messagesTab) && messagesControl == null) {
    messagesControl = new MessagingControl(tabFolder, SWT.NONE, accountId,
        nxt, engine, userService, sync);
    messagesTab.setControl(messagesControl);
  }
  else if (tab.equals(assetsTab) && assetsControl == null) {
    assetsControl = new AssetsControl(tabFolder, SWT.NONE, accountId, nxt,
        userService, contactsService, sync, engine);
    assetsTab.setControl(assetsControl);
  }
}
 
Example #21
Source File: TmxEditor.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
public void createContent(TmxEditorViewer viewPart, Composite container) {
	this.parentComposite = container;
	this.viewPart = viewPart;
	GridLayout containerGdLt = new GridLayout(1, true);
	containerGdLt.marginWidth = 0;
	containerGdLt.marginHeight = 0;
	containerGdLt.verticalSpacing = 5;
	containerGdLt.marginTop = 0;
	containerGdLt.marginLeft = 0;
	containerGdLt.marginRight = 0;
	container.setLayout(containerGdLt);

	// tab 设置,分为数据查询以及品质检查
	TabFolder tab = new TabFolder(container, SWT.NONE);
	tab.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
	TabItem editorItm = new TabItem(tab, SWT.NONE);
	editorItm.setText(Messages.getString("tmxeditor.filter.editor"));

	TabItem qaItm = new TabItem(tab, SWT.NONE);
	qaItm.setText(Messages.getString("tmxeditor.filter.qa"));

	Composite editorCmp = new Composite(tab, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(editorCmp);
	GridLayoutFactory.fillDefaults().numColumns(2).applyTo(editorCmp);
	createEditorArea(editorCmp);
	editorItm.setControl(editorCmp);

	Composite qaCmp = new Composite(tab, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).applyTo(qaCmp);
	GridLayoutFactory.fillDefaults().numColumns(2).applyTo(qaCmp);
	createQaArea(qaCmp);
	qaItm.setControl(qaCmp);

	// create nattable composite
	Composite nattableComposite = new Composite(container, SWT.NONE);
	nattableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
	createNattable(nattableComposite, srcLangCode, tgtLangCode);
}
 
Example #22
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 #23
Source File: FormatterModifyDialog.java    From APICloud-Studio with GNU General Public License v3.0 5 votes vote down vote up
protected void addTabPage(String title, IFormatterModifiyTabPage tabPage)
{
	final TabItem tabItem = new TabItem(fTabFolder, SWT.NONE);
	applyDialogFont(tabItem.getControl());
	tabItem.setText(title);
	tabItem.setData(tabPage);
	tabItem.setControl(tabPage.createContents(controlManager, fTabFolder));
	fTabPages.add(tabPage);
}
 
Example #24
Source File: ClassPathsPageHelper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
private void createTabFolderArea( Composite composite )
{
	Composite tabArea = new Composite( composite, SWT.NONE );
	GridLayout layout = new GridLayout( 1, false );
	layout.marginWidth = 10;
	tabArea.setLayout( layout );
	GridData gd = new GridData( GridData.FILL_BOTH );
	tabArea.setLayoutData( gd );
	
	tabFolder = new TabFolder( tabArea, SWT.TOP );
	tabFolder.setLayoutData( new GridData( GridData.FILL_BOTH ) );

	runtimePage = new POJOClassTabFolderPage( this,
			getApplResourceDir( ) );
	runtimePage.setPrompMessage( Messages.getString( "DataSource.POJOClassTabFolderPage.promptLabel.runtime" ) ); //$NON-NLS-1$
	TabItem runtimeTab = runtimePage.createContents( tabFolder );
	runtimeTab.setText( Messages.getString( "DataSource.POJOClasses.tab.runtime" ) ); //$NON-NLS-1$

	designtimePage = new POJOClassTabFolderPage( this,
			getApplResourceDir( ) );
	designtimePage.setPrompMessage( Messages.getString( "DataSource.POJOClassTabFolderPage.promptLabel.designtime" ) ); //$NON-NLS-1$
	TabItem designTimeTab = designtimePage.createContents( tabFolder );
	designTimeTab.setText( Messages.getString( "DataSource.POJOClasses.tab.designTime" ) ); //$NON-NLS-1$

	runtimePage.setFriendPage( designtimePage );
	designtimePage.setFriendPage( runtimePage );

	initControlValues( );
}
 
Example #25
Source File: HadoopLocationWizard.java    From RDFS with Apache License 2.0 5 votes vote down vote up
TabMain(TabMediator mediator) {
  this.mediator = mediator;
  TabItem tab = new TabItem(mediator.folder, SWT.NONE);
  tab.setText("General");
  tab.setToolTipText("General location parameters");
  tab.setImage(circle);
  tab.setControl(createControl(mediator.folder));
}
 
Example #26
Source File: AbstractDependenciesConfigurationWizardPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void createControl(final Composite parent) {
    final Composite tabComposite = new Composite(parent, SWT.NONE);
    tabComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    tabComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());

    final Label descriptionLabel = new Label(tabComposite, SWT.WRAP);
    descriptionLabel.setText(getDescription());
    descriptionLabel.setLayoutData(GridDataFactory.swtDefaults().grab(true, false).create());

    final TabFolder tabFolder = new TabFolder(tabComposite, SWT.TOP);
    tabFolder.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    tabFolder.addSelectionListener(new SelectionAdapter() {

        @Override
        public void widgetSelected(final SelectionEvent e) {
            if (treeViewer != null) {
                treeViewer.refresh();
            }
            if (rawViewer != null) {
                rawViewer.refresh();
            }
        }
    });

    final TabItem treeClasspathItem = new TabItem(tabFolder, SWT.NONE);
    treeClasspathItem.setText(Messages.hiearachical);
    treeClasspathItem.setControl(createTreeClasspathControl(tabFolder));

    final TabItem rawClasspathItem = new TabItem(tabFolder, SWT.NONE);
    rawClasspathItem.setText(Messages.raw);
    rawClasspathItem.setControl(createRawClasspathControl(tabFolder));

    setControl(tabComposite);
}
 
Example #27
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 #28
Source File: LogFileTab.java    From LogViewer with Eclipse Public License 2.0 5 votes vote down vote up
public LogFileTab(String key, TabItem item, LogDocument document) {
    this.key = key;
    this.item = item;
    this.document = document;
    this.selection = null;
    this.topIndex = 0;
}
 
Example #29
Source File: CordovaPluginSelectionPage.java    From thym with Eclipse Public License 1.0 5 votes vote down vote up
public int getPluginSourceType(){
	TabItem selected = getSelectedTabItem();
	if(selected == gitTab )
		return PLUGIN_SOURCE_GIT;
	if(selected == directoryTab )
		return PLUGIN_SOURCE_DIRECTORY;
	return PLUGIN_SOURCE_REGISTRY; // defaults to registry;
}
 
Example #30
Source File: EditboxPreferencePage.java    From gama with GNU General Public License v3.0 5 votes vote down vote up
@Override
public boolean performCancel() {
	final TabItem[] items = folder.getItems();
	for (int i = 1; i < items.length; i++) {
		final Object o = items[i].getData();
		if (o instanceof BoxSettingsTab) {
			((BoxSettingsTab) o).cancel();
		}
	}

	if (providersChanged) {
		BoxProviderRegistry.getInstance().setProviders(null);
	}
	return true;
}