use of com.amalto.workbench.widgets.PageingToolBar in project tmdm-studio-se by Talend.
the class DataClusterComposite method createPageToolbar.
protected void createPageToolbar(Composite composite) {
pageToolBar = new PageingToolBar(composite);
pageToolBar.getComposite().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 9, 1));
pageToolBar.getComposite().setVisible(false);
pageToolBar.setPageingListener(this);
}
use of com.amalto.workbench.widgets.PageingToolBar in project tmdm-studio-se by Talend.
the class RoutingEngineV2BrowserMainPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
try {
// sets the title
managedForm.getForm().setText(this.getTitle());
// get the toolkit
FormToolkit toolkit = managedForm.getToolkit();
// get the body
Composite composite = managedForm.getForm().getBody();
composite.setLayout(new GridLayout(1, false));
// Create a Router status holder
Composite statusComposite = toolkit.createComposite(composite, SWT.NONE);
statusComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
statusComposite.setLayout(new GridLayout(5, false));
// status
Label descriptionLabel = toolkit.createLabel(statusComposite, Messages.RoutingEngineV2BrowserMainPage_EventManagerStatus, SWT.NULL);
descriptionLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
// $NON-NLS-1$
statusLabel = toolkit.createLabel(statusComposite, " ", SWT.NULL);
statusLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
startButton = toolkit.createButton(statusComposite, BLANK, SWT.PUSH);
startButton.setImage(ImageCache.getCreatedImage(EImage.RUN_EXC.getPath()));
startButton.setToolTipText(Messages.RoutingEngineV2BrowserMainPage_Start);
startButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
startButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
startSubscriptionEngine();
updateButtons();
}
});
stopButton = toolkit.createButton(statusComposite, BLANK, SWT.PUSH);
stopButton.setImage(ImageCache.getCreatedImage(EImage.STOP.getPath()));
stopButton.setToolTipText(Messages.RoutingEngineV2BrowserMainPage_Stop);
stopButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
stopButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
stopSubscriptionEngine();
updateButtons();
}
});
suspendButton = toolkit.createButton(statusComposite, BLANK, SWT.PUSH);
suspendButton.setImage(ImageCache.getCreatedImage(EImage.SUSPEND.getPath()));
suspendButton.setToolTipText(Messages.RoutingEngineV2BrowserMainPage_Suspend);
suspendButton.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, true, 1, 1));
suspendButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
suspendSubscriptionEngine();
updateButtons();
}
});
Composite separator = toolkit.createCompositeSeparator(composite);
separator.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
((GridData) separator.getLayoutData()).heightHint = 2;
// first Line of routing Orders
Composite firstLineComposite = toolkit.createComposite(composite);
firstLineComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
firstLineComposite.setLayout(new GridLayout(9, false));
// Routing Orders Label
Label routingOrdersLabel = toolkit.createLabel(firstLineComposite, Messages.RoutingEngineV2BrowserMainPage_RoutingOrders, SWT.NULL);
routingOrdersLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 9, 1));
// from
Label fromLabel = toolkit.createLabel(firstLineComposite, Messages.RoutingEngineV2BrowserMainPage_From, SWT.NULL);
fromLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
CalendarSelectWidget fromCalendar = new CalendarSelectWidget(toolkit, firstLineComposite, true);
fromText = fromCalendar.getText();
// to
Label toLabel = toolkit.createLabel(firstLineComposite, Messages.RoutingEngineV2BrowserMainPage_To, SWT.NULL);
toLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
CalendarSelectWidget toCalendar = new CalendarSelectWidget(toolkit, firstLineComposite, false);
toText = toCalendar.getText();
Label statusLab = toolkit.createLabel(firstLineComposite, Messages.RoutingEngineV2BrowserMainPage_Status, SWT.NULL);
statusLab.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
statusCombo = new Combo(firstLineComposite, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.MULTI);
statusCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
statusCombo.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if ((e.stateMask == 0) && (e.character == SWT.CR)) {
doSearch();
}
}
});
// $NON-NLS-1$
statusCombo.add("FAILED");
// $NON-NLS-1$
statusCombo.add("COMPLETED");
statusCombo.select(0);
// to
Button bSearch = toolkit.createButton(firstLineComposite, BLANK, SWT.CENTER);
bSearch.setImage(ImageCache.getCreatedImage(EImage.BROWSE.getPath()));
bSearch.setToolTipText(Messages.RoutingEngineV2BrowserMainPage_Search);
bSearch.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
bSearch.addListener(SWT.Selection, new Listener() {
public void handleEvent(Event event) {
pageToolBar.reset();
doSearch();
}
});
// Second Line of routing Orders
Composite searchLineComposite = toolkit.createComposite(composite);
searchLineComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
searchLineComposite.setLayout(new GridLayout(4, false));
// document type
Label documentTypeLabel = toolkit.createLabel(searchLineComposite, Messages.RoutingEngineV2BrowserMainPage_DocumentType, SWT.NULL);
documentTypeLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
// DocumentType
documentTypeText = toolkit.createText(searchLineComposite, BLANK, SWT.BORDER);
documentTypeText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1));
((GridData) documentTypeText.getLayoutData()).widthHint = 120;
documentTypeText.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if ((e.stateMask == 0) && (e.character == SWT.CR)) {
doSearch();
}
}
});
// ID
Label idLabel = toolkit.createLabel(searchLineComposite, Messages.RoutingEngineV2BrowserMainPage_ItemIDs, SWT.NULL);
idLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
// ID
idText = toolkit.createText(searchLineComposite, BLANK, SWT.BORDER);
idText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
idText.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if ((e.stateMask == 0) && (e.character == SWT.CR)) {
doSearch();
}
}
});
// service
Label serviceLabel = toolkit.createLabel(searchLineComposite, Messages.RoutingEngineV2BrowserMainPage_Service, SWT.NULL);
serviceLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
// service
serviceCombo = new Combo(searchLineComposite, SWT.READ_ONLY | SWT.DROP_DOWN | SWT.MULTI);
serviceCombo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
serviceCombo.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if ((e.stateMask == 0) && (e.character == SWT.CR)) {
doSearch();
}
}
});
serviceCombo.add(BLANK);
// WSServicesListItem[] servicesList = Util.getPort(getXObject()).getServicesList(new
// WSGetServicesList("en")).getItem();
// $NON-NLS-1$
List<WSServicesListItem> servicesList = getMDMService().getServicesList(new WSGetServicesList("en")).getItem();
if ((servicesList != null) && (servicesList.size() > 0)) {
String[] services = new String[servicesList.size()];
for (int i = 0; i < servicesList.size(); i++) {
// $NON-NLS-1$
services[i] = servicesList.get(i).getJndiName().replaceFirst("amalto/local/service/", BLANK);
}
Arrays.sort(services);
for (String service : services) {
serviceCombo.add(service);
}
}
serviceCombo.select(0);
// any Field
Label anyFieldLabel = toolkit.createLabel(searchLineComposite, Messages.RoutingEngineV2BrowserMainPage_AnyField, SWT.NULL);
anyFieldLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
// anyField
anyFieldText = toolkit.createText(searchLineComposite, BLANK, SWT.BORDER);
anyFieldText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
anyFieldText.addKeyListener(new KeyAdapter() {
@Override
public void keyReleased(KeyEvent e) {
if ((e.stateMask == 0) && (e.character == SWT.CR)) {
doSearch();
}
}
});
// pageToolBar
pageToolBar = new PageingToolBar(composite);
pageToolBar.getComposite().setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 9, 1));
pageToolBar.getComposite().setVisible(false);
pageToolBar.setPageingListener(this);
final Table table = createTable(composite);
resultsViewer = new TableViewer(table);
resultsViewer.getControl().setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
// ((GridData) resultsViewer.getControl().getLayoutData()).heightHint = 500;
resultsViewer.setContentProvider(new ArrayContentProvider());
resultsViewer.setLabelProvider(new ClusterTableLabelProvider());
resultsViewer.addDoubleClickListener(new IDoubleClickListener() {
public void doubleClick(DoubleClickEvent event) {
resultsViewer.setSelection(event.getSelection());
try {
new EditItemAction(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), resultsViewer).run();
} catch (Exception e) {
MessageDialog.openError(RoutingEngineV2BrowserMainPage.this.getSite().getShell(), Messages._Error, Messages.bind(Messages.RoutingEngineV2BrowserMainPage_ErrorMsg, e.getClass().getName(), e.getLocalizedMessage()));
}
}
});
hookContextMenu();
// nothing will show on the form if not called
managedForm.reflow(true);
// adapt body add mouse/focus listener for child
WidgetFactory factory = WidgetFactory.getWidgetFactory();
factory.adapt(managedForm.getForm().getBody());
updateButtons();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
Aggregations