use of org.eclipse.jface.viewers.IDoubleClickListener in project cubrid-manager by CUBRID.
the class JobAutoDashboardEditorPart method createBackupPlanInfoTable.
public void createBackupPlanInfoTable(Composite parent) {
parent.setLayout(new GridLayout(1, false));
ToolBar toolBar = new ToolBar(parent, SWT.RIGHT);
toolBar.setLayoutData(CommonUITool.createGridData(1, 1, -1, -1));
ToolItem refreshItem = new ToolItem(toolBar, SWT.PUSH);
refreshItem.setText(com.cubrid.common.ui.cubrid.table.Messages.tablesDetailInfoPartRefreshBtn);
refreshItem.setImage(CommonUIPlugin.getImage("icons/action/refresh.png"));
refreshItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
refreshBackupPlan();
}
});
ToolItem createItem = new ToolItem(toolBar, SWT.PUSH);
createItem.setText(Messages.jobAutoInfoDetailPartCreateBackupBtn);
createItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_add.png"));
createItem.setEnabled(canAddOrEdit);
createItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
addBackupPlan();
}
});
ToolItem editItem = new ToolItem(toolBar, SWT.PUSH);
editItem.setText(Messages.jobAutoInfoDetailPartEditBackupBtn);
editItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_edit.png"));
editItem.setEnabled(canAddOrEdit);
editItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
editBackupPlan();
}
});
ToolItem deleteItem = new ToolItem(toolBar, SWT.PUSH);
deleteItem.setText(Messages.jobAutoInfoDetailPartDeleteBackupBtn);
deleteItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_delete.png"));
deleteItem.setEnabled(canAddOrEdit);
deleteItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
deleteBackupPlan();
}
});
ToolItem openLogItem = new ToolItem(toolBar, SWT.PUSH);
openLogItem.setText(Messages.jobAutoInfoDetailPartOpenBackupLogBtn);
openLogItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_log.png"));
openLogItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(final SelectionEvent event) {
openBackupPlanLog();
}
});
final Composite tableComposite = new Composite(parent, SWT.NONE);
tableComposite.setLayout(new FillLayout());
tableComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
backupPlanInfoTable = new TableViewer(tableComposite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER);
backupPlanInfoTable.getTable().setHeaderVisible(true);
backupPlanInfoTable.getTable().setLinesVisible(true);
backupPlanInfoTable.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
editBackupPlan();
}
});
final TableViewerColumn idColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
idColumn.getColumn().setWidth(80);
idColumn.getColumn().setText(Messages.backupPlanInfoTableIDColumn);
final TableViewerColumn levelColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
levelColumn.getColumn().setWidth(80);
levelColumn.getColumn().setText(Messages.backupPlanInfoTableLevelColumn);
final TableViewerColumn pathColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
pathColumn.getColumn().setWidth(200);
pathColumn.getColumn().setText(Messages.backupPlanInfoTablePathColumn);
final TableViewerColumn periodTypeColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
periodTypeColumn.getColumn().setWidth(100);
periodTypeColumn.getColumn().setText(Messages.backupPlanInfoTablePeriodTypeColumn);
final TableViewerColumn backupDetailColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
backupDetailColumn.getColumn().setWidth(150);
backupDetailColumn.getColumn().setText(Messages.backupPlanInfoTablePeriodDetailColumn);
final TableViewerColumn backupTimeColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
backupTimeColumn.getColumn().setWidth(90);
backupTimeColumn.getColumn().setText(Messages.backupPlanInfoTablePeriodTimeColumn);
if (isSupportPeriodicAutoJob) {
final TableViewerColumn backupIntervalColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
backupIntervalColumn.getColumn().setWidth(100);
backupIntervalColumn.getColumn().setText(Messages.backupPlanInfoTablePeriodIntervalColumn);
}
final TableViewerColumn onOffLineColumn = new TableViewerColumn(backupPlanInfoTable, SWT.LEFT);
onOffLineColumn.getColumn().setWidth(100);
onOffLineColumn.getColumn().setText(Messages.backupPlanInfoTableOnlineOfflineColumn);
backupPlanInfoTable.setContentProvider(new BackupPlanTableViewerContentProvider());
backupPlanInfoTable.setLabelProvider(new BackupPlanTableViewerLabelProvider());
backupPlanInfoTable.getTable().addFocusListener(new FocusAdapter() {
public void focusGained(FocusEvent event) {
ActionManager.getInstance().changeFocusProvider(backupPlanInfoTable.getTable());
}
});
MenuManager menuManager = new MenuManager();
menuManager.setRemoveAllWhenShown(true);
Menu contextMenu = menuManager.createContextMenu(backupPlanInfoTable.getTable());
backupPlanInfoTable.getTable().setMenu(contextMenu);
Menu menu = new Menu(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), SWT.POP_UP);
final MenuItem createMenuItem = new MenuItem(menu, SWT.PUSH);
createMenuItem.setText(Messages.jobAutoInfoDetailPartCreateBackupBtn);
createMenuItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_add.png"));
createMenuItem.setEnabled(canAddOrEdit);
createMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
addBackupPlan();
}
});
final MenuItem editMenuItem = new MenuItem(menu, SWT.PUSH);
editMenuItem.setText(Messages.jobAutoInfoDetailPartEditBackupBtn);
editMenuItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_edit.png"));
editMenuItem.setEnabled(canAddOrEdit);
editMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
editBackupPlan();
}
});
final MenuItem dropMenuItem = new MenuItem(menu, SWT.PUSH);
dropMenuItem.setText(Messages.jobAutoInfoDetailPartDeleteBackupBtn);
dropMenuItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_backup_delete.png"));
dropMenuItem.setEnabled(canAddOrEdit);
dropMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
deleteBackupPlan();
}
});
final MenuItem openLogMenuItem = new MenuItem(menu, SWT.PUSH);
openLogMenuItem.setText(Messages.jobAutoInfoDetailPartOpenBackupLogBtn);
openLogMenuItem.setImage(CubridManagerUIPlugin.getImage("icons/action/auto_log.png"));
openLogMenuItem.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
openBackupPlanLog();
}
});
backupPlanInfoTable.getTable().setMenu(menu);
}
use of org.eclipse.jface.viewers.IDoubleClickListener in project tdi-studio-se by Talend.
the class ExtendedNodeReviewDialog method createDialogArea.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
//$NON-NLS-1$
TimeMeasure.step(RepositoryReviewDialog.class.getSimpleName(), "before createDialogArea...");
GridData data = (GridData) container.getLayoutData();
data.minimumHeight = 400;
data.heightHint = 400;
data.minimumWidth = 500;
data.widthHint = 500;
container.setLayoutData(data);
textFilter = new ViewerTextFilter();
createFilterField(container);
treeViewer = provider.createViewer(container);
treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
getButton(IDialogConstants.OK_ID).setEnabled(isValidSelection(event));
}
});
treeViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
if (getButton(IDialogConstants.OK_ID).isEnabled()) {
okPressed();
}
}
});
treeViewer.addFilter(textFilter);
treeViewer.addFilter(new ViewerFilter() {
@Override
public boolean select(Viewer viewer, Object parentElement, Object element) {
return filterByType(viewer, parentElement, element);
}
});
return container;
}
use of org.eclipse.jface.viewers.IDoubleClickListener in project tdi-studio-se by Talend.
the class TalendExportPage method createTreeViewer.
protected Composite createTreeViewer(Composite parent) {
IWizardCategory root = WorkbenchPlugin.getDefault().getExportWizardRegistry().getRootCategory();
// exportTree = new TalendCategorizedWizardSelectionTree(root,
// WorkbenchMessages.ExportWizard_selectDestination);
exportTree = new TalendCategorizedWizardSelectionTree(root, //$NON-NLS-1$
Messages.getString("WorkbenchMessages.ExportWizard_selectDestination"));
Composite exportComp = exportTree.createControl(parent);
exportTree.getViewer().addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
listSelectionChanged(event.getSelection());
}
});
exportTree.getViewer().addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
treeDoubleClicked(event);
}
});
setTreeViewer(exportTree.getViewer());
return exportComp;
}
use of org.eclipse.jface.viewers.IDoubleClickListener in project tdi-studio-se by Talend.
the class ListStringValueDialog method createDialogArea.
/**
* Create contents of the dialog
*
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
Composite container = (Composite) super.createDialogArea(parent);
tableViewer = new TableViewer(container, SWT.FULL_SELECTION | SWT.BORDER);
table = tableViewer.getTable();
table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
TableLayout layout = new TableLayout();
table.setLayout(layout);
layout.addColumnData(new ColumnWeightData(100));
final TableColumn tableColumn = new TableColumn(table, SWT.NONE);
tableColumn.setAlignment(SWT.CENTER);
tableColumn.setWidth(100);
tableColumn.setText("column");
tableViewer.setContentProvider(new ArrayContentProvider());
tableViewer.setLabelProvider(new ViewerLabelProvider());
tableViewer.setInput(dataList);
tableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
selectObj = selection.getFirstElement();
}
});
tableViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(final DoubleClickEvent event) {
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
selectObj = selection.getFirstElement();
setReturnCode(0);
close();
}
});
//
return container;
}
use of org.eclipse.jface.viewers.IDoubleClickListener in project bndtools by bndtools.
the class PluginClassSelectionPage method createControl.
public void createControl(Composite parent) {
setTitle("Plug-in Type");
setDescription("Select from one of the following known plug-in types.");
// Create controls
Composite composite = new Composite(parent, SWT.NONE);
table = new Table(composite, SWT.FULL_SELECTION | SWT.BORDER);
viewer = new TableViewer(table);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setSorter(new PluginClassSorter());
viewer.setLabelProvider(new PluginDeclarationLabelProvider());
// txtDescription = new ScrolledFormText(composite, true);
// Load data
IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(Plugin.PLUGIN_ID, "bndPlugins");
viewer.setInput(elements);
// Listeners
viewer.addSelectionChangedListener(new ISelectionChangedListener() {
public void selectionChanged(SelectionChangedEvent event) {
if (!programmaticChange) {
try {
programmaticChange = true;
IStructuredSelection sel = (IStructuredSelection) viewer.getSelection();
setSelectedElement((IConfigurationElement) sel.getFirstElement());
} finally {
programmaticChange = false;
}
}
}
});
viewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
getContainer().showPage(getNextPage());
}
});
// Layout
GridLayout layout;
GridData gd;
layout = new GridLayout(1, false);
composite.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
table.setLayoutData(gd);
gd = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1);
gd.heightHint = 150;
// txtDescription.setLayoutData(gd);
setControl(composite);
}
Aggregations