use of org.eclipse.swt.widgets.TabFolder in project cubrid-manager by CUBRID.
the class ShardWizardAllInfoPage method createControl.
/**
* Create the control for this page
*
* @param parent
* the parent composite
*/
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginHeight = 10;
layout.marginWidth = 10;
composite.setLayout(layout);
GridData gridData = new GridData(GridData.FILL_BOTH);
composite.setLayoutData(gridData);
Label tipLabel = new Label(composite, SWT.LEFT | SWT.WRAP);
tipLabel.setText(Messages.msgDbInfoList);
gridData = new GridData(GridData.FILL_HORIZONTAL);
tipLabel.setLayoutData(gridData);
gridData = new GridData(GridData.FILL_BOTH);
TabFolder tabFolder = new TabFolder(composite, SWT.NONE);
tabFolder.setLayoutData(gridData);
tabFolder.setLayout(new GridLayout());
gridData = new GridData(GridData.FILL_BOTH);
shardGeneralInfoText = new Text(tabFolder, SWT.LEFT | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
shardGeneralInfoText.setEditable(false);
shardGeneralInfoText.setLayoutData(gridData);
gridData = new GridData(GridData.FILL_BOTH);
shardBrokerInfoText = new Text(tabFolder, SWT.LEFT | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
shardBrokerInfoText.setEditable(false);
shardBrokerInfoText.setLayoutData(gridData);
gridData = new GridData(GridData.FILL_BOTH);
shardConnectionInfoText = new Text(tabFolder, SWT.LEFT | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
shardConnectionInfoText.setEditable(false);
shardConnectionInfoText.setLayoutData(gridData);
gridData = new GridData(GridData.FILL_BOTH);
shardKeyInfoText = new Text(tabFolder, SWT.LEFT | SWT.WRAP | SWT.BORDER | SWT.V_SCROLL);
shardKeyInfoText.setEditable(false);
shardKeyInfoText.setLayoutData(gridData);
TabItem item = new TabItem(tabFolder, SWT.NONE);
item.setText("General");
item.setControl(shardGeneralInfoText);
item = new TabItem(tabFolder, SWT.NONE);
item.setText("Broker");
item.setControl(shardBrokerInfoText);
item = new TabItem(tabFolder, SWT.NONE);
item.setText("Connection");
item.setControl(shardConnectionInfoText);
item = new TabItem(tabFolder, SWT.NONE);
item.setText("Key");
item.setControl(shardKeyInfoText);
initialize();
setTitle("All Information");
setMessage("Add a new shard broker.");
setControl(composite);
// TODO why this method called again?
initialize();
}
use of org.eclipse.swt.widgets.TabFolder in project bndtools by bndtools.
the class AdvancedSearchDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
setTitle("Advanced Search");
setMessage("Perform a search for resource capabilities in the Repositories. Select the\ncapability namespace using the tab bar.");
Composite area = (Composite) super.createDialogArea(parent);
tabFolder = new TabFolder(area, SWT.TOP);
tabFolder.setLayoutData(new GridData(GridData.FILL_BOTH));
PropertyChangeListener changeListener = new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent evt) {
updateFromPanel();
}
};
final List<Image> images = new LinkedList<Image>();
for (Entry<String, SearchPanel> panelEntry : panelMap.entrySet()) {
String title = panelEntry.getKey();
SearchPanel panel = panelEntry.getValue();
Composite container = new Composite(tabFolder, SWT.NONE);
container.setLayout(new GridLayout(1, false));
Control control = panel.createControl(container);
GridData controlLayoutData = new GridData(SWT.FILL, SWT.CENTER, true, true);
controlLayoutData.widthHint = 200;
control.setLayoutData(controlLayoutData);
TabItem item = new TabItem(tabFolder, SWT.NONE);
item.setText(title);
item.setControl(container);
item.setData(panel);
Image image = panel.createImage(tabFolder.getDisplay());
if (image != null) {
images.add(image);
item.setImage(image);
}
panel.addPropertyChangeListener(changeListener);
}
tabFolder.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
for (Image image : images) {
if (!image.isDisposed())
image.dispose();
}
}
});
tabFolder.setSelection(activeTabIndex);
SearchPanel currentPanel = (SearchPanel) tabFolder.getItem(activeTabIndex).getData();
currentPanel.setFocus();
requirement = currentPanel.getRequirement();
tabFolder.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
activeTabIndex = tabFolder.getSelectionIndex();
updateFromPanel();
getSelectedPanel().setFocus();
}
});
return area;
}
use of org.eclipse.swt.widgets.TabFolder in project linuxtools by eclipse.
the class PerfEventsTab method createEventTabs.
private void createEventTabs(Composite top, ILaunchConfiguration config) {
// Maybe not the best place to load the event list but we'll see.
Map<String, List<String>> events = PerfCore.getEventList(config);
// the special counters should be last
ArrayList<String> tmpTabNames = new ArrayList<>(events.keySet());
final List<String> SPECIAL_EVENTS = Arrays.asList(new String[] { PerfPlugin.STRINGS_HWBREAKPOINTS, PerfPlugin.STRINGS_RAWHWEvents });
tmpTabNames.removeAll(SPECIAL_EVENTS);
tmpTabNames.addAll(SPECIAL_EVENTS);
String[] tabNames = tmpTabNames.toArray(new String[0]);
eventTabItems = new TabItem[tabNames.length];
eventTable = new Table[tabNames.length];
tabFolder = new TabFolder(top, SWT.NONE);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// Initialize each tab.
for (int i = 0; i < tabNames.length; i++) {
eventTabItems[i] = new TabItem(tabFolder, SWT.NONE);
eventTabItems[i].setText(tabNames[i]);
// These are for the two special tabs for custom events.
if (tabNames[i].equals(PerfPlugin.STRINGS_HWBREAKPOINTS) || tabNames[i].equals(PerfPlugin.STRINGS_RAWHWEvents)) {
// Composite to contain it all
Composite c = new Composite(tabFolder, SWT.NONE);
c.setLayout(new GridLayout(2, false));
// A list to check off existing custom events (or show the new ones added)
Table table = new Table(c, SWT.CHECK | SWT.MULTI);
eventTable[i] = table;
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
table.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
updateLaunchConfigurationDialog();
}));
// Right side to enter new events and delete old ones
Composite right = new Composite(c, SWT.NONE);
right.setLayout(new GridLayout(2, false));
right.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, true));
// for adding
Label l = new Label(right, SWT.NONE);
l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
Text t = new Text(right, SWT.SINGLE | SWT.BORDER);
t.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));
if (tabNames[i].equals(PerfPlugin.STRINGS_HWBREAKPOINTS)) {
bpTabIndex = i;
bpText = t;
l.setText(Messages.PerfEventsTab_HardwareBreakpoint);
}
if (tabNames[i].equals(PerfPlugin.STRINGS_RAWHWEvents)) {
rawTabIndex = i;
rawText = t;
l.setText(Messages.PerfEventsTab_RawRegisterEncoding);
}
Button b = new Button(right, SWT.PUSH);
b.setText(Messages.PerfEventsTab_Add);
b.setLayoutData(new GridData(SWT.RIGHT, SWT.TOP, false, false));
b.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
int index = tabFolder.getSelectionIndex();
if (rawTabIndex == index) {
new TableItem(eventTable[index], SWT.NONE).setText(rawText.getText());
} else if (bpTabIndex == index) {
new TableItem(eventTable[index], SWT.NONE).setText(bpText.getText());
}
updateLaunchConfigurationDialog();
}));
l = new Label(right, SWT.NONE);
l.setForeground(new Color(right.getDisplay(), 100, 100, 100));
if (tabNames[i].equals(PerfPlugin.STRINGS_HWBREAKPOINTS)) {
l.setText(Messages.PerfEventsTab_ForExample);
}
if (tabNames[i].equals(PerfPlugin.STRINGS_RAWHWEvents)) {
l.setText(Messages.PerfEventsTab_ForExampleR1A8);
}
l.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
// spacer label.
l = new Label(right, SWT.NONE);
l.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
// for removing
b = new Button(right, SWT.PUSH);
b.setText(Messages.PerfEventsTab_RemoveSelectedEvents);
b.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 2, 1));
b.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> {
eventTable[tabFolder.getSelectionIndex()].remove(eventTable[tabFolder.getSelectionIndex()].getSelectionIndices());
updateLaunchConfigurationDialog();
}));
l = new Label(right, SWT.NONE);
l.setForeground(new Color(right.getDisplay(), 100, 100, 100));
l.setText(Messages.PerfEventsTab_Note);
l.setLayoutData(new GridData(SWT.FILL, SWT.BOTTOM, true, false, 2, 1));
eventTabItems[i].setControl(c);
} else {
// This loads all the events 'perf list' gives into their respective tabs.
Table table = new Table(tabFolder, SWT.CHECK);
eventTable[i] = table;
List<String> eventList = events.get(tabNames[i]);
for (String event : eventList) {
TableItem item = new TableItem(table, SWT.NONE);
item.setText(event);
}
table.addSelectionListener(SelectionListener.widgetSelectedAdapter(e -> updateLaunchConfigurationDialog()));
eventTabItems[i].setControl(table);
}
}
}
use of org.eclipse.swt.widgets.TabFolder in project linuxtools by eclipse.
the class AbstractEventConfigTab method createCounterTabs.
/**
* @since 1.1
* @param top
*/
private void createCounterTabs(Composite top) {
// tabs for each of the counters
counters = getOprofileCounters(null);
TabItem[] counterTabs = new TabItem[counters.length];
// create only one counter for operf/opcontrol
if (counters.length > 0) {
counterSubTabs = new CounterSubTab[1];
} else {
counterSubTabs = new CounterSubTab[0];
}
TabFolder tabFolder = new TabFolder(top, SWT.NONE);
tabFolder.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
// This approach would make operf/opcontrol event selection more similar.
for (int i = 0; i < counters.length; i++) {
Composite c = new Composite(tabFolder, SWT.NONE);
CounterSubTab currentTab = new CounterSubTab(c, counters[i]);
counterSubTabs[i] = currentTab;
counterTabs[i] = new TabItem(tabFolder, SWT.NONE);
counterTabs[i].setControl(c);
// $NON-NLS-1$
counterTabs[i].setText(OprofileLaunchMessages.getString("tab.event.counterTab.counterText"));
// just one tab for operf/opcontrol
break;
}
getTabFolderComposite();
}
use of org.eclipse.swt.widgets.TabFolder in project knime-core by knime.
the class SubnodeLayoutJSONEditorPage method createControl.
/**
* {@inheritDoc}
*/
@Override
public void createControl(final Composite parent) {
TabFolder tabs = new TabFolder(parent, SWT.BORDER);
TabItem usageTab = new TabItem(tabs, SWT.NONE);
usageTab.setText("Node Usage");
m_nodeUsageComposite = new NodeUsageComposite(tabs, m_viewNodes, m_subNodeContainer);
usageTab.setControl(m_nodeUsageComposite);
usageTab.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(final DisposeEvent e) {
m_nodeUsageComposite = null;
}
});
TabItem basicTab = new TabItem(tabs, SWT.NONE);
basicTab.setText("Basic Layout");
basicTab.setControl(createBasicComposite(tabs));
TabItem jsonTab = new TabItem(tabs, SWT.NONE);
jsonTab.setText("Advanced Layout");
jsonTab.setControl(createJSONEditorComposite(tabs));
setControl(tabs);
}
Aggregations