use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class FindDialog method createButtonsForButtonBar.
/*
* @see Dialog#createButtonsForButtonBar(Composite)
*/
@Override
protected void createButtonsForButtonBar(Composite parent) {
findButton = createButton(parent, IDialogConstants.CLIENT_ID, Messages.findButtonLabel, true);
findButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
doFind();
}
});
createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CLOSE_LABEL, false);
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class HotSpotsFilteredTree method configureTree.
/*
* @see AbstractFilteredTree#configureTree()
*/
@Override
protected void configureTree() {
for (TreeColumn column : getViewer().getTree().getColumns()) {
column.dispose();
}
getViewer().getTree().setLinesVisible(true);
getViewer().getTree().setHeaderVisible(true);
for (Entry<String, Boolean> entry : columns.entrySet()) {
HotSpotsColumn column = getColumn(entry.getKey());
String label = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnName() : column.label;
String toolTip = (column == HotSpotsColumn.HOT_SPOT) ? getMethodColumnToolTip() : column.toolTip;
if (!columns.get(label)) {
continue;
}
TreeColumn treeColumn = new TreeColumn(getViewer().getTree(), SWT.NONE);
treeColumn.setText(label);
treeColumn.setWidth(column.defalutWidth);
treeColumn.setAlignment(column.alignment);
treeColumn.setToolTipText(toolTip);
treeColumn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof TreeColumn) {
sortColumn((TreeColumn) e.widget);
}
}
});
}
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class HeapHistogramPage method configureTree.
/**
* Configure the tree adding columns.
*/
private void configureTree() {
Tree tree = heapViewer.getTree();
if (tree.isDisposed()) {
return;
}
for (TreeColumn column : tree.getColumns()) {
column.dispose();
}
tree.setLinesVisible(true);
tree.setHeaderVisible(true);
for (Entry<String, Boolean> entry : columns.entrySet()) {
HeapColumn column = HeapColumn.getColumn(entry.getKey());
if (!columns.get(column.label)) {
continue;
}
TreeColumn treeColumn = new TreeColumn(tree, SWT.NONE);
treeColumn.setText(column.label);
treeColumn.setWidth(column.defalutWidth);
treeColumn.setAlignment(column.alignment);
treeColumn.setToolTipText(column.toolTip);
treeColumn.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
if (e.widget instanceof TreeColumn) {
sortColumn((TreeColumn) e.widget);
}
}
});
}
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class RepositoryWebService method addListenerForWSDLCom.
private void addListenerForWSDLCom() {
refreshbut.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
ProgressMonitorDialog progressDialog = new ProgressMonitorDialog(PlatformUI.getWorkbench().getDisplay().getActiveShell().getShell());
IRunnableWithProgress runnable = new IRunnableWithProgress() {
public void run(final IProgressMonitor monitor) {
//$NON-NLS-1$
monitor.beginTask("Retrieve WSDL parameter from net.", IProgressMonitor.UNKNOWN);
Display.getDefault().syncExec(new Runnable() {
public void run() {
getDataFromNet();
}
});
monitor.done();
}
};
try {
progressDialog.run(true, true, runnable);
} catch (InvocationTargetException e1) {
ExceptionHandler.process(e1);
} catch (InterruptedException e1) {
ExceptionHandler.process(e1);
} catch (WebServiceCancelException e1) {
return;
}
if (currentPortName != null) {
connection.setPortName(currentPortName.getPortName());
} else if (currentPortName == null && allPortNames != null) {
currentPortName = allPortNames.get(0);
connection.setPortName(currentPortName.getPortName());
}
listTable.setSelection(listTable.getItem(0));
if (currentFunction != null) {
connection.setMethodName(currentFunction.getName());
connection.setServerNameSpace(currentFunction.getServerNameSpace());
connection.setServerName(currentFunction.getServerName());
connection.setPortNameSpace(currentFunction.getServerNameSpace());
}
// listTable.select(0);
isFirst = false;
}
});
// TableItem firstItem = listTable.getItem(0);
// currentFunction = firstItem.getData();
listTable = listTableView.getTable();
portListTable = portListTableView.getTable();
listTable.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TableItem[] item = listTable.getSelection();
currentFunction = (Function) item[0].getData();
if (currentFunction != null) {
connection.setServerName(currentFunction.getServerName());
connection.setServerNameSpace(currentFunction.getServerNameSpace());
connection.setMethodName(currentFunction.getName());
}
// if select the same as before ,don't change it
// IElementParameter METHODPara = connector.getElementParameter("METHOD"); //$NON-NLS-1$
// Object obj = METHODPara.getValue();
// if (currentFunction.getName().equals(obj.toString())) {
// return;
// }
List<ParameterInfo> listIn = currentFunction.getInputParameters();
List<ParameterInfo> listOut = currentFunction.getOutputParameters();
}
});
portListTable.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
TableItem[] item = portListTable.getSelection();
currentPortName = (PortNames) item[0].getData();
connection.setPortName(currentPortName.getPortName());
}
});
}
use of org.eclipse.swt.events.SelectionAdapter in project tdi-studio-se by Talend.
the class AddArrayIndexDialog method createDialogArea.
protected Control createDialogArea(Composite parent) {
Composite createDialogArea = (Composite) super.createDialogArea(parent);
GridLayout layout = new GridLayout();
layout.horizontalSpacing = 1;
layout.numColumns = 2;
createDialogArea.setLayout(layout);
GridData data = new GridData(GridData.FILL_HORIZONTAL);
GridData layoutData = new GridData(GridData.FILL_HORIZONTAL);
layoutData.horizontalSpan = 2;
arrayButton = new Button(createDialogArea, SWT.RADIO);
arrayButton.setText("Get all the list element.");
arrayButton.setLayoutData(layoutData);
arrayButton.setSelection(true);
arrayButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
text.setEnabled(false);
}
});
arrayToItemButton = new Button(createDialogArea, SWT.RADIO);
arrayToItemButton.setText("Get one element of the list.");
arrayToItemButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
text.setEnabled(true);
}
});
data = new GridData(GridData.FILL_HORIZONTAL);
data.horizontalSpan = 1;
text = new Text(createDialogArea, SWT.BORDER);
text.setLayoutData(data);
text.setEnabled(false);
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
indexText = text.getText();
// String com = text.getText();
// int index = Integer.valueOf(com);
// if(index<0||index>arraySize){
//
// }
}
});
return createDialogArea;
}
Aggregations