use of org.eclipse.wst.server.ui.internal.view.servers.ModuleServer in project liferay-ide by liferay.
the class RedeployAction method selectionChanged.
@Override
public void selectionChanged(IAction action, ISelection selection) {
boolean validServerState = true;
if (!selection.isEmpty()) {
final List<ModuleServer> newModules = new ArrayList<>();
if (selection instanceof IStructuredSelection) {
final IStructuredSelection obj = (IStructuredSelection) selection;
final Iterator selectionIterator = obj.iterator();
while (selectionIterator.hasNext()) {
ModuleServer moduleServer = (ModuleServer) selectionIterator.next();
newModules.add(moduleServer);
validServerState = validServerState && ((moduleServer.getServer().getServerState() & getRequiredServerState()) > 0);
}
this.selectedModules = newModules.toArray(new ModuleServer[0]);
action.setEnabled(validServerState);
}
}
}
Aggregations