use of org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout in project webtools.sourceediting by eclipse.
the class FilePreferencePage method createContents.
protected Control createContents(Composite parent) {
Composite composite = createComposite(parent, 1);
// $NON-NLS-1$
String description = SSEUIMessages.FilePreferencePage_0;
createLabel(composite, description);
// $NON-NLS-1$
createLabel(composite, "");
TabFolder folder = new TabFolder(composite, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
// TabItem taskItem = new TabItem(folder, SWT.NONE);
// IPreferenceTab tasksTab = new TaskTagPreferenceTab();
// taskItem.setText(tasksTab.getTitle());
// Control taskTags = tasksTab.createContents(folder);
// taskItem.setControl(taskTags);
TabItem translucenceItem = new TabItem(folder, SWT.NONE);
IPreferenceTab translucenceTab = new TranslucencyPreferenceTab(this);
translucenceItem.setText(translucenceTab.getTitle());
Control translucenceControl = translucenceTab.createContents(folder);
translucenceItem.setControl(translucenceControl);
fTabs = new IPreferenceTab[] { /*tasksTab,*/
translucenceTab };
return composite;
}
use of org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout in project webtools.sourceediting by eclipse.
the class StructuredTextEditorPreferencePage method createContents.
/*
* @see PreferencePage#createContents(Composite)
*/
protected Control createContents(Composite parent) {
// need to create tabs before loading/starting overlaystore in case
// tabs also add values
IPreferenceTab hoversTab = new TextHoverPreferenceTab(this, fOverlayStore);
fOverlayStore.load();
fOverlayStore.start();
TabFolder folder = new TabFolder(parent, SWT.NONE);
folder.setLayout(new TabFolderLayout());
folder.setLayoutData(new GridData(GridData.FILL_BOTH));
TabItem item = new TabItem(folder, SWT.NONE);
// $NON-NLS-1$
item.setText(SSEUIMessages.StructuredTextEditorPreferencePage_0);
item.setControl(createAppearancePage(folder));
item = new TabItem(folder, SWT.NONE);
item.setText(hoversTab.getTitle());
item.setControl(hoversTab.createContents(folder));
fTabs = new IPreferenceTab[] { hoversTab };
initialize();
Dialog.applyDialogFont(folder);
return folder;
}
use of org.eclipse.wst.sse.ui.internal.preferences.TabFolderLayout in project webtools.sourceediting by eclipse.
the class TaskTagPreferencePage method createCommonContents.
protected Control createCommonContents(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout compositeLayout = new GridLayout();
compositeLayout.marginLeft = 0;
compositeLayout.marginRight = 0;
composite.setLayout(compositeLayout);
IScopeContext[] preferenceScopes = createPreferenceScopes();
fOriginalEnableTaskTags = fEnableTaskTags = fPreferencesService.getBoolean(getPreferenceNodeQualifier(), TaskTagPreferenceKeys.TASK_TAG_ENABLE, false, preferenceScopes);
fEnableCheckbox = new Button(composite, SWT.CHECK);
fEnableCheckbox.setSelection(fEnableTaskTags);
// $NON-NLS-1$
fEnableCheckbox.setText(SSEUIMessages.TaskTagPreferenceTab_31);
fEnableCheckbox.setSelection(fEnableTaskTags);
fEnableCheckbox.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING, GridData.VERTICAL_ALIGN_END, false, false, 1, 1));
fTabFolder = new TabFolder(composite, SWT.NONE);
fTabFolder.setLayout(new TabFolderLayout());
fTabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
TabItem taskItem = new TabItem(fTabFolder, SWT.NONE);
MainTab mainTab = new MainTab(this, fPreferencesService, preferenceScopes);
taskItem.setText(mainTab.getTitle());
final Control taskTagsControl = mainTab.createContents(fTabFolder);
taskItem.setControl(taskTagsControl);
TabItem exclusionItem = new TabItem(fTabFolder, SWT.NONE);
ExclusionsTab exclusionsTab = new ExclusionsTab(this, fPreferencesService, preferenceScopes);
exclusionItem.setText(exclusionsTab.getTitle());
final Control exclusionControl = exclusionsTab.createContents(fTabFolder);
exclusionItem.setControl(exclusionControl);
fTabs = new IPreferenceTab[] { mainTab, exclusionsTab };
fTabEnablementListener = new SelectionAdapter() {
ControlEnableState[] lastEnableStates = null;
public void widgetSelected(SelectionEvent e) {
fEnableTaskTags = fEnableCheckbox.getSelection();
if (fEnableTaskTags) {
if (lastEnableStates != null) {
for (int i = 0; i < lastEnableStates.length; i++) {
if (lastEnableStates[i] != null) {
lastEnableStates[i].restore();
}
}
lastEnableStates = null;
fTabFolder.redraw();
}
} else if (lastEnableStates == null) {
lastEnableStates = new ControlEnableState[fTabs.length + 1];
lastEnableStates[0] = ControlEnableState.disable(taskTagsControl);
lastEnableStates[1] = ControlEnableState.disable(exclusionControl);
if (fRedetectButton != null) {
lastEnableStates[2] = ControlEnableState.disable(fRedetectButton);
}
}
}
};
fTabEnablementListener.widgetSelected(null);
fEnableCheckbox.addSelectionListener(fTabEnablementListener);
// restore last selected tab
int activeTab = new DefaultScope().getNode(getPreferenceNodeQualifier()).getInt(TASK_TAG_LAST_TAB, 0);
if (activeTab > 0) {
fTabFolder.setSelection(activeTab);
}
SSEUIPlugin.getDefault().getWorkbench().getHelpSystem().setHelp(composite, IHelpContextIds.PREFWEBX_TASKTAGS_HELPID);
return composite;
}
Aggregations