Search in sources :

Example 6 with ContextMenu

use of name.abuchen.portfolio.ui.util.ContextMenu in project portfolio by buchen.

the class AttributeListTab method createTab.

@Override
public CTabItem createTab(CTabFolder folder) {
    Composite container = new Composite(folder, SWT.NONE);
    TableColumnLayout layout = new TableColumnLayout();
    container.setLayout(layout);
    tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.MULTI);
    ColumnEditingSupport.prepare(tableViewer);
    ShowHideColumnHelper support = new ShowHideColumnHelper(AttributeListTab.class.getSimpleName(), preferences, tableViewer, layout);
    addColumns(support);
    support.createColumns();
    tableViewer.getTable().setHeaderVisible(true);
    tableViewer.getTable().setLinesVisible(true);
    tableViewer.setContentProvider(new ArrayContentProvider());
    tableViewer.setInput(client.getSettings().getAttributeTypes().toArray());
    tableViewer.refresh();
    new ContextMenu(tableViewer.getTable(), m -> fillContextMenu(m)).hook();
    CTabItem item = new CTabItem(folder, SWT.NONE);
    item.setText(Messages.AttributeTypeTitle);
    item.setControl(container);
    return item;
}
Also used : ContextMenu(name.abuchen.portfolio.ui.util.ContextMenu) IPreferenceStore(org.eclipse.jface.preference.IPreferenceStore) Client(name.abuchen.portfolio.model.Client) TableViewer(org.eclipse.jface.viewers.TableViewer) Images(name.abuchen.portfolio.ui.Images) Image(org.eclipse.swt.graphics.Image) TableColumnLayout(org.eclipse.jface.layout.TableColumnLayout) Inject(javax.inject.Inject) ModificationListener(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport.ModificationListener) Composite(org.eclipse.swt.widgets.Composite) Messages(name.abuchen.portfolio.ui.Messages) StringEditingSupport(name.abuchen.portfolio.ui.util.viewers.StringEditingSupport) Separator(org.eclipse.jface.action.Separator) Shell(org.eclipse.swt.widgets.Shell) CTabFolder(org.eclipse.swt.custom.CTabFolder) Column(name.abuchen.portfolio.ui.util.viewers.Column) Action(org.eclipse.jface.action.Action) Security(name.abuchen.portfolio.model.Security) UUID(java.util.UUID) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ColumnLabelProvider(org.eclipse.jface.viewers.ColumnLabelProvider) ColumnEditingSupport(name.abuchen.portfolio.ui.util.viewers.ColumnEditingSupport) ShowHideColumnHelper(name.abuchen.portfolio.ui.util.viewers.ShowHideColumnHelper) Tab(name.abuchen.portfolio.ui.views.settings.SettingsView.Tab) CTabItem(org.eclipse.swt.custom.CTabItem) IMenuManager(org.eclipse.jface.action.IMenuManager) SWT(org.eclipse.swt.SWT) AttributeType(name.abuchen.portfolio.model.AttributeType) LabelOnly(name.abuchen.portfolio.ui.util.LabelOnly) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ClientSettings(name.abuchen.portfolio.model.ClientSettings) Composite(org.eclipse.swt.widgets.Composite) TableColumnLayout(org.eclipse.jface.layout.TableColumnLayout) ShowHideColumnHelper(name.abuchen.portfolio.ui.util.viewers.ShowHideColumnHelper) ArrayContentProvider(org.eclipse.jface.viewers.ArrayContentProvider) ContextMenu(name.abuchen.portfolio.ui.util.ContextMenu) TableViewer(org.eclipse.jface.viewers.TableViewer) CTabItem(org.eclipse.swt.custom.CTabItem)

Aggregations

ContextMenu (name.abuchen.portfolio.ui.util.ContextMenu)6 Composite (org.eclipse.swt.widgets.Composite)6 Image (org.eclipse.swt.graphics.Image)5 Images (name.abuchen.portfolio.ui.Images)4 Messages (name.abuchen.portfolio.ui.Messages)4 Action (org.eclipse.jface.action.Action)4 IMenuManager (org.eclipse.jface.action.IMenuManager)4 SWT (org.eclipse.swt.SWT)4 Inject (javax.inject.Inject)3 ShowHideColumnHelper (name.abuchen.portfolio.ui.util.viewers.ShowHideColumnHelper)3 Separator (org.eclipse.jface.action.Separator)3 GridDataFactory (org.eclipse.jface.layout.GridDataFactory)3 IPreferenceStore (org.eclipse.jface.preference.IPreferenceStore)3 Control (org.eclipse.swt.widgets.Control)3 StringJoiner (java.util.StringJoiner)2 Consumer (java.util.function.Consumer)2 Collectors (java.util.stream.Collectors)2 Dashboard (name.abuchen.portfolio.model.Dashboard)2 AbstractDropDown (name.abuchen.portfolio.ui.util.AbstractDropDown)2 InfoToolTip (name.abuchen.portfolio.ui.util.InfoToolTip)2