use of org.jboss.tools.openshift.internal.common.ui.TableCellMouseAdapter in project jbosstools-openshift by jbosstools.
the class ServicesAndRoutingPage method onTableCellClicked.
private MouseListener onTableCellClicked() {
return new TableCellMouseAdapter(ROUTE_PORT_COLUMN_INDEX) {
@Override
public void mouseUpCell(MouseEvent event) {
IServicePort port = model.getSelectedServicePort();
ServicePortAdapter target = new ServicePortAdapter((ServicePortAdapter) port);
target.setRoutePort(!target.isRoutePort());
target.setName(NLS.bind("{0}-tcp", target.getPort()));
model.updateServicePort(port, target);
model.setSelectedServicePort(target);
Display.getDefault().asyncExec(() -> {
if (portsViewer != null && portsViewer.getTable() != null && !portsViewer.getTable().isDisposed()) {
portsViewer.refresh();
}
});
}
};
}
Aggregations