Skip to content
This repository has been archived by the owner on Mar 15, 2022. It is now read-only.

Commit

Permalink
HAL-343 / BZ1028443: Disable deployment browser buttons until referen…
Browse files Browse the repository at this point in the history
…ce server is resolved
  • Loading branch information
hpehl committed Sep 28, 2015
1 parent 1d1795c commit a414478
Showing 1 changed file with 38 additions and 24 deletions.
Expand Up @@ -22,8 +22,6 @@
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.SingleSelectionModel;
import com.google.inject.Inject;

import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.core.FeatureSet;
import org.jboss.as.console.client.domain.model.HostInformationStore;
Expand Down Expand Up @@ -58,6 +56,9 @@ public class ServerGroupDeploymentBrowser
private ServerGroupRecord currentServerGroup;
private DeploymentBrowser deploymentBrowser;
private FeatureSet featureSet;
private ToolButton assign;
private ToolButton remove;
private ToolButton enableDisable;


public ServerGroupDeploymentBrowser(final DomainDeploymentPresenter presenter,
Expand All @@ -76,45 +77,40 @@ Widget asWidget()
keyProvider);

ToolStrip tools = new ToolStrip();
tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_assign(), new
ClickHandler()
{
assign = new ToolButton(Console.CONSTANTS.common_label_assign(), new
ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent)
{
public void onClick(ClickEvent clickEvent) {
presenter.launchAssignDeploymentToGroupWizard(currentServerGroup);
}
}));
tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_remove(), new
});
tools.addToolButtonRight(assign);
remove = new ToolButton(Console.CONSTANTS.common_label_remove(), new


ClickHandler()
{
ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent)
{
public void onClick(ClickEvent clickEvent) {
DeploymentRecord selection = selectionModel.getSelectedObject();
if (selection != null)
{
if (selection != null) {
presenter.onRemoveDeploymentInGroup(selection);
}
}
}));
tools.addToolButtonRight(new ToolButton(Console.CONSTANTS.common_label_enOrDisable(), new
});
tools.addToolButtonRight(remove);
enableDisable = new ToolButton(Console.CONSTANTS.common_label_enOrDisable(), new


ClickHandler()
{
ClickHandler() {
@Override
public void onClick(ClickEvent clickEvent)
{
public void onClick(ClickEvent clickEvent) {
DeploymentRecord selection = selectionModel.getSelectedObject();
if (selection != null)
{
if (selection != null) {
presenter.onDisableDeploymentInGroup(selection);
}
}
}));
});
tools.addToolButtonRight(enableDisable);

deploymentBrowser = new DeploymentBrowser(deploymentStore, selectionModel, featureSet);

Expand Down Expand Up @@ -149,6 +145,13 @@ public void updateGroup(final ServerGroupRecord serverGroup, final List<Deployme
}
if (anyEnabled)
{
// HAL-343 / BZ1028443: Disable until reference server is resolved
final boolean assignEnabled = assign.isEnabled();
final boolean removeEnabled = remove.isEnabled();
final boolean enableDisableEnabled = enableDisable.isEnabled();
assign.setEnabled(false);
remove.setEnabled(false);
enableDisable.setEnabled(false);
hostInfoStore.loadServerInstances(currentServerGroup.getName(), new SimpleCallback<List<ServerInstance>>()
{
@Override
Expand Down Expand Up @@ -182,6 +185,17 @@ public void onSuccess(final List<DeploymentRecord> result)
{
Console.warning("No active server in this group.", "Unable to retrieve deployment subsystem information. ");
}
assign.setEnabled(assignEnabled);
remove.setEnabled(removeEnabled);
enableDisable.setEnabled(enableDisableEnabled);
}

@Override
public void onFailure(final Throwable caught) {
super.onFailure(caught);
assign.setEnabled(assignEnabled);
remove.setEnabled(removeEnabled);
enableDisable.setEnabled(enableDisableEnabled);
}

ServerInstance matchingServer(ServerInstance server)
Expand Down

0 comments on commit a414478

Please sign in to comment.