modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java | 21 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java | 11 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java | 5 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java | 34 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java | 31 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java | 18 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java | 80 +++--- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java | 14 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java | 132 +++++----- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java | 83 ++---- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java | 18 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java | 13 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java | 27 -- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java | 43 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java | 20 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java | 51 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java | 8 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java | 39 +- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java | 41 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/calltime/CallTimeView.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java | 3 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/detail/OperationDetailsView.java | 50 +-- modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java | 20 - modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java | 2 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java | 7 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHeaderControl.java | 53 ++++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableMenu.java | 38 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java | 4 modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableWindow.java | 38 ++ modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java | 13 44 files changed, 565 insertions(+), 424 deletions(-)
New commits: commit 285ef938d0fc9b25d323f0747a103b96fe406280 Merge: 16114a5... 20be9ec... Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Aug 31 21:22:04 2010 -0400
Merge branch 'master' into master-jay
commit 16114a5e2c9968ae2cf9753ca957a2f184649cbe Author: Jay Shaughnessy jshaughn@redhat.com Date: Tue Aug 31 21:18:18 2010 -0400
Selenium Work - Add destroyMembers utility and use as necessary to avoid ID conflict (Layout.removeMembers does not always destroy in a timely manner) - Make breadcrumb IDs more unique in case multiple breadcrumbs have the same name (e.g. 10001). - Add more robust ID assignment and fix various bugs in Bundle section (ID related and others) - Add IDs to Administration Section stack and other admin pages - Add IDs to some Alert pages
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java index 0d23ba9..44586b1 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/BreadcrumbTrailPane.java @@ -21,13 +21,13 @@ package org.rhq.enterprise.gui.coregui.client; import com.google.gwt.user.client.Window; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.types.VerticalAlignment; -import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.Img; import com.smartgwt.client.widgets.Label; import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableLabel; +import org.rhq.enterprise.gui.coregui.client.util.selenium.SeleniumUtility;
/** * GWT widget for the breadcrumb trail, which is displayed at the top of each page. @@ -51,10 +51,7 @@ public class BreadcrumbTrailPane extends ToolStrip { public void refresh(ViewPath viewPath) { try { // before rebuilding the trail, remove the current members, and destroy them to avoid ID conflicts - for (Canvas currentMember : getMembers()) { - removeMember(currentMember); - currentMember.destroy(); - } + SeleniumUtility.destroyMembers(this);
LayoutSpacer ls = new LayoutSpacer(); ls.setWidth(5); @@ -110,8 +107,8 @@ public class BreadcrumbTrailPane extends ToolStrip { private Label getCrumb(Breadcrumb crumb, String path) { Label l = null; if (crumb.isHyperlink()) { - l = new LocatableLabel(crumb.getName(), "<a href="#" + path.toString() + crumb.getName() + "">" - + crumb.getDisplayName() + "</a>"); + String fullPath = path.toString() + crumb.getName(); + l = new LocatableLabel(fullPath, "<a href="#" + fullPath + "">" + crumb.getDisplayName() + "</a>"); } else { l = new Label(crumb.getDisplayName()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java index 2e0003f..fc69f1f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/AdministrationView.java @@ -41,6 +41,8 @@ import org.rhq.enterprise.gui.coregui.client.admin.users.UsersView; import org.rhq.enterprise.gui.coregui.client.components.FullHTMLPane; import org.rhq.enterprise.gui.coregui.client.inventory.resource.discovery.ResourceAutodiscoveryView; import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableSectionStack; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid;
/** * @author Greg Hinkle @@ -73,7 +75,7 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable contentCanvas.setWidth("*"); contentCanvas.setHeight100();
- sectionStack = new SectionStack(); + sectionStack = new LocatableSectionStack(this.getLocatorId()); sectionStack.setShowResizeBar(true); sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE); sectionStack.setWidth(250); @@ -117,7 +119,7 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable
private TreeGrid buildSecuritySection() {
- final TreeGrid securityTreeGrid = new TreeGrid(); + final TreeGrid securityTreeGrid = new LocatableTreeGrid("Security"); securityTreeGrid.setLeaveScrollbarGap(false); securityTreeGrid.setShowHeader(false);
@@ -143,7 +145,7 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable
private TreeGrid buildManagementClusterSection() {
- final TreeGrid mgmtClusterTreeGrid = new TreeGrid(); + final TreeGrid mgmtClusterTreeGrid = new LocatableTreeGrid("Topology"); mgmtClusterTreeGrid.setLeaveScrollbarGap(false); mgmtClusterTreeGrid.setShowHeader(false);
@@ -163,7 +165,7 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable
private TreeGrid buildSystemConfigurationSection() {
- final TreeGrid systemConfigTreeGrid = new TreeGrid(); + final TreeGrid systemConfigTreeGrid = new LocatableTreeGrid("Config"); systemConfigTreeGrid.setLeaveScrollbarGap(false); systemConfigTreeGrid.setShowHeader(false);
@@ -184,7 +186,7 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable
private TreeGrid buildReportsSection() {
- final TreeGrid reportsTreeGrid = new TreeGrid(); + final TreeGrid reportsTreeGrid = new LocatableTreeGrid("Reports"); reportsTreeGrid.setLeaveScrollbarGap(false); reportsTreeGrid.setShowHeader(false);
@@ -227,13 +229,13 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable } else if ("Security".equals(section)) {
if ("Manage Users".equals(page)) { - content = new UsersView(extendLocatorId("Users")); + content = new UsersView(this.extendLocatorId("Users")); } else if ("Manage Roles".equals(page)) { - content = new RolesView(extendLocatorId("Roles")); + content = new RolesView(this.extendLocatorId("Roles")); } else if ("Auto Discovery Queue".equals(page)) { - content = new ResourceAutodiscoveryView(extendLocatorId("ADQ")); + content = new ResourceAutodiscoveryView(this.extendLocatorId("ADQ")); } else if ("Remote Agent Install".equals(page)) { - content = new RemoteAgentInstallView(); + content = new RemoteAgentInstallView(this.extendLocatorId("RemoteAgentInstall")); } } else if ("Configuration".equals(section)) {
@@ -278,7 +280,6 @@ public class AdministrationView extends LocatableHLayout implements Bookmarkable
setContent(content);
- }
public void renderView(ViewPath viewPath) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java index 926fa49..78aba28 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/agent/install/RemoteAgentInstallView.java @@ -51,11 +51,13 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.gwt.RemoteInstallGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class RemoteAgentInstallView extends VLayout { +public class RemoteAgentInstallView extends LocatableVLayout {
private RemoteInstallGWTServiceAsync remoteInstallService = GWTServiceLookup.getRemoteInstallService();
@@ -66,7 +68,8 @@ public class RemoteAgentInstallView extends VLayout { private ButtonItem stopButton; private VLayout agentInfoLayout;
- public RemoteAgentInstallView() { + public RemoteAgentInstallView(String locatorId) { + super(locatorId); setMembersMargin(1); setWidth100(); setHeight100(); @@ -88,7 +91,7 @@ public class RemoteAgentInstallView extends VLayout { }
private DynamicForm getConnectionForm() { - connectionForm = new DynamicForm(); + connectionForm = new LocatableDynamicForm(this.extendLocatorId("Connection")); connectionForm.setWidth100(); connectionForm.setNumCols(3); connectionForm.setWrapItemTitles(false); @@ -167,7 +170,7 @@ public class RemoteAgentInstallView extends VLayout { }
private DynamicForm getButtons() { - buttonsForm = new DynamicForm(); + buttonsForm = new LocatableDynamicForm(this.extendLocatorId("ButtonForm")); buttonsForm.setWidth("75%"); buttonsForm.setNumCols(4); buttonsForm.setMargin(20); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java index 4c7b047..75e5553 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/AbstractAlertDefinitionsView.java @@ -116,13 +116,14 @@ public abstract class AbstractAlertDefinitionsView extends TableSection { }
AlertDefinition alertDef = getAlertDefinitionDataSource().copyValues(record); - SingleAlertDefinitionView singleAlertDefinitionView = new SingleAlertDefinitionView(alertDef); + SingleAlertDefinitionView singleAlertDefinitionView = new SingleAlertDefinitionView(this.getLocatorId(), + alertDef); return singleAlertDefinitionView; }
@Override public SingleAlertDefinitionView getDetailsView(int id) { - final SingleAlertDefinitionView singleAlertDefinitionView = new SingleAlertDefinitionView(); + final SingleAlertDefinitionView singleAlertDefinitionView = new SingleAlertDefinitionView(this.getLocatorId());
if (id == 0) { // create an empty one with all defaults diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java index 810d31e..f8fb8a3 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/alert/definitions/SingleAlertDefinitionView.java @@ -27,16 +27,18 @@ import com.smartgwt.client.widgets.Button; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.HLayout; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.tab.Tab; -import com.smartgwt.client.widgets.tab.TabSet;
import org.rhq.core.domain.alert.AlertDefinition; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTab; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTabSet; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author John Mazzitelli */ -public class SingleAlertDefinitionView extends VLayout { +public class SingleAlertDefinitionView extends LocatableVLayout {
private AlertDefinition alertDefinition; private GeneralPropertiesAlertDefinitionForm generalProperties; @@ -49,33 +51,35 @@ public class SingleAlertDefinitionView extends VLayout { private Button saveButton; private Button cancelButton;
- public SingleAlertDefinitionView() { - this(null); + public SingleAlertDefinitionView(String locatorId) { + this(locatorId, null); }
- public SingleAlertDefinitionView(AlertDefinition alertDefinition) { + public SingleAlertDefinitionView(String locatorId, AlertDefinition alertDefinition) { + super(locatorId); + this.alertDefinition = alertDefinition;
- TabSet tabSet = new TabSet(); + LocatableTabSet tabSet = new LocatableTabSet(this.getLocatorId()); tabSet.setHeight100();
- Tab generalPropertiesTab = new Tab("General Properties"); + Tab generalPropertiesTab = new LocatableTab(tabSet.extendLocatorId("General"), "General Properties"); generalProperties = new GeneralPropertiesAlertDefinitionForm(alertDefinition); generalPropertiesTab.setPane(generalProperties);
- Tab conditionsTab = new Tab("Conditions"); + Tab conditionsTab = new LocatableTab(tabSet.extendLocatorId("Conditions"), "Conditions"); conditions = new ConditionsAlertDefinitionForm(alertDefinition); conditionsTab.setPane(conditions);
- Tab notificationsTab = new Tab("Notifications"); + Tab notificationsTab = new LocatableTab(tabSet.extendLocatorId("Notifications"), "Notifications"); notifications = new NotificationsAlertDefinitionForm(alertDefinition); notificationsTab.setPane(notifications);
- Tab recoveryTab = new Tab("Recovery"); + Tab recoveryTab = new LocatableTab(tabSet.extendLocatorId("Recovery"), "Recovery"); recovery = new RecoveryAlertDefinitionForm(alertDefinition); recoveryTab.setPane(recovery);
- Tab dampeningTab = new Tab("Dampening"); + Tab dampeningTab = new LocatableTab(tabSet.extendLocatorId("Dampening"), "Dampening"); dampening = new DampeningAlertDefinitionForm(alertDefinition); dampeningTab.setPane(dampening);
@@ -84,9 +88,9 @@ public class SingleAlertDefinitionView extends VLayout { final HLayout buttons = new HLayout(); buttons.setMembersMargin(20);
- editButton = new Button("Edit"); - saveButton = new Button("Save"); - cancelButton = new Button("Cancel"); + editButton = new LocatableButton(this.extendLocatorId("Edit"), "Edit"); + saveButton = new LocatableButton(this.extendLocatorId("Save"), "Save"); + cancelButton = new LocatableButton(this.extendLocatorId("Cancel"), "Cancel");
editButton.show(); saveButton.hide(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 32fd4fc..54e425e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -88,6 +88,8 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab }
private void viewBundleDeployment(BundleDeployment bundleDeployment, ViewId current) { + // Whenever a new view request comes in, make sure to clean house to avoid ID conflicts for sub-widgets + this.destroyMembers();
this.deployment = bundleDeployment; this.version = bundleDeployment.getBundleVersion(); @@ -99,7 +101,7 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab
addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png"), deployment.getName()));
- LocatableDynamicForm form = new LocatableDynamicForm(getLocatorId()); + LocatableDynamicForm form = new LocatableDynamicForm(extendLocatorId("Summary")); form.setNumCols(4);
LinkItem bundleName = new LinkItem("bundle"); @@ -147,11 +149,7 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab
addMember(form);
- Table deployments = createDeploymentsTable(); - deployments.setHeight("30%"); - deployments.setShowResizeBar(true); - deployments.setResizeBarTarget("next"); - addMember(deployments); + addMemberDeploymentsTable();
detail = new VLayout(); detail.setAutoHeight(); @@ -159,7 +157,7 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab addMember(detail); }
- private Table createDeploymentsTable() { + private Table addMemberDeploymentsTable() { Table table = new Table(extendLocatorId("Deployments"), "Deployment Machines");
table.setTitleComponent(new HTMLFlow("Select a row to show install details.")); @@ -197,8 +195,6 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab status.setValueIconHeight(11); status.setWidth(80);
- table.getListGrid().setFields(resourceIcon, resource, resourceVersion, status); - ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>(); for (BundleResourceDeployment rd : deployment.getResourceDeployments()) { ListGridRecord record = new ListGridRecord(); @@ -214,6 +210,14 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab records.add(record); }
+ // To get the ListGrid the Table must be initialized (via onInit()) by adding to the Canvas + table.setHeight("30%"); + table.setShowResizeBar(true); + table.setResizeBarTarget("next"); + addMember(table); + + table.getListGrid().setFields(resourceIcon, resource, resourceVersion, status); + table.getListGrid().setData(records.toArray(new ListGridRecord[records.size()]));
table.getListGrid().addSelectionChangedHandler(new SelectionChangedHandler() { @@ -223,7 +227,7 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab BundleResourceDeployment bundleResourceDeployment = (BundleResourceDeployment) selectionEvent .getRecord().getAttributeAsObject("entity"); BundleResourceDeploymentHistoryListView detailView = new BundleResourceDeploymentHistoryListView( - bundleResourceDeployment); + "Detail", bundleResourceDeployment);
detail.removeMembers(detail.getMembers()); detail.addMember(detailView); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java index ed474b1..d9c00cd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleResourceDeploymentHistoryListView.java @@ -40,20 +40,23 @@ import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord; import com.smartgwt.client.widgets.grid.events.RecordClickEvent; import com.smartgwt.client.widgets.grid.events.RecordClickHandler; -import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.bundle.BundleDeploymentStatus; import org.rhq.core.domain.bundle.BundleResourceDeployment; import org.rhq.core.domain.bundle.BundleResourceDeploymentHistory; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableListGrid; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class BundleResourceDeploymentHistoryListView extends VLayout { +public class BundleResourceDeploymentHistoryListView extends LocatableVLayout {
private BundleResourceDeployment resourceDeployment;
- public BundleResourceDeploymentHistoryListView(BundleResourceDeployment resourceDeployment) { + public BundleResourceDeploymentHistoryListView(String locatorId, BundleResourceDeployment resourceDeployment) { + super(locatorId); + setWidth100(); setHeight100(); this.resourceDeployment = resourceDeployment; @@ -64,7 +67,7 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { protected void onInit() { super.onInit();
- ListGrid grid = new ListGrid(); + ListGrid grid = new LocatableListGrid(this.getLocatorId()); grid.setWidth100(); grid.setHeight100();
@@ -86,7 +89,6 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { grid.setExpansionMode(ExpansionMode.DETAIL_FIELD); grid.setDetailField("message");
- ListGridField details = new ListGridField("attachment", "Details"); details.setWidth(50); details.setCellFormatter(new CellFormatter() { @@ -106,7 +108,6 @@ public class BundleResourceDeploymentHistoryListView extends VLayout {
}
- private void showDetails(ListGridRecord record) {
DynamicForm form = new DynamicForm(); @@ -116,20 +117,16 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { StaticTextItem category = new StaticTextItem("category", "Category"); StaticTextItem message = new StaticTextItem("message", "Message");
- AutoFitTextAreaItem detail = new AutoFitTextAreaItem("attachement", "Detail"); detail.setTitleOrientation(TitleOrientation.TOP); detail.setColSpan(2);
- ButtonItem close = new ButtonItem("close", "Close");
- form.setItems(action, info, category, message, detail, close);
form.editRecord(record);
- final Window window = new Window(); window.setTitle("Install Details"); window.setWidth(800); @@ -148,7 +145,6 @@ public class BundleResourceDeploymentHistoryListView extends VLayout { }); }
- public ListGridRecord[] buildRecords() { ArrayList<ListGridRecord> records = new ArrayList<ListGridRecord>();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 8297e49..ea8496c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -79,6 +79,8 @@ public class BundleDestinationView extends LocatableVLayout implements Bookmarka }
private void viewBundleDestination(BundleDestination bundleDestination, ViewId current) { + // Whenever a new view request comes in, make sure to clean house to avoid ID conflicts for sub-widgets + this.destroyMembers();
this.destination = bundleDestination; this.bundle = bundleDestination.getBundle(); @@ -259,7 +261,6 @@ public class BundleDestinationView extends LocatableVLayout implements Bookmarka CoreGUI.refreshBreadCrumbTrail();
viewBundleDestination(destination, viewPath.getCurrent()); - } });
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 9fde57b..bc6076a 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -72,6 +72,9 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { private int bundleBeingViewed = 0; private HeaderLabel headerLabel; private Table bundleVersionsTable; + private TabSet tabs; + private Tab versionsTab; + private Tab destinationsTab;
private BundleGWTServiceAsync bundleManager = GWTServiceLookup.getBundleService();
@@ -91,7 +94,8 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { }
public void viewBundle(Bundle bundle, ViewId nextViewId) { - removeMembers(getMembers()); + // Whenever a new view request comes in, make sure to clean house to avoid ID conflicts for sub-widgets + this.destroyMembers();
this.bundle = bundle;
@@ -103,22 +107,19 @@ public class BundleView extends LocatableVLayout implements BookmarkableView {
addMember(createSummaryForm());
- TabSet tabs = new LocatableTabSet(getLocatorId()); - - Tab versionsTab = createVersionsTab(); + tabs = new LocatableTabSet(getLocatorId()); + versionsTab = createVersionsTab(); tabs.addTab(versionsTab);
- Tab deploymentsTab = createDestinationsTab(); - tabs.addTab(deploymentsTab); + destinationsTab = createDestinationsTab(); + tabs.addTab(destinationsTab);
addMember(tabs);
- if (nextViewId != null) { - if (nextViewId.getPath().equals("versions")) { - tabs.selectTab(versionsTab); - } else if (nextViewId.getPath().equals("desinations")) { - tabs.selectTab(deploymentsTab); - } + if ((null == nextViewId) || (nextViewId.getPath().equals("versions"))) { + tabs.selectTab(versionsTab); + } else if (nextViewId.getPath().equals("destinations")) { + tabs.selectTab(destinationsTab); }
markForRedraw(); @@ -272,7 +273,6 @@ public class BundleView extends LocatableVLayout implements BookmarkableView {
public void renderView(final ViewPath viewPath) { int bundleId = Integer.parseInt(viewPath.getCurrent().getPath()); - final ViewId viewId = viewPath.getCurrent();
viewPath.next(); @@ -298,43 +298,49 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { viewId.getBreadcrumbs().set(0, new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); viewBundle(bundle, viewPath.getCurrent()); - // viewId.getBreadcrumbs().add(new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); CoreGUI.refreshBreadCrumbTrail(); } }); + } else if (!viewPath.isEnd()) { + String current = viewPath.getCurrent().getPath(); + if ("versions".equals(current)) { + tabs.selectTab(versionsTab); + } else if ("destinations".equals(current)) { + tabs.selectTab(destinationsTab); + } + // The tab change forces an update so fix up the breadcrumb to use displayName and not just the path + viewId.getBreadcrumbs().set(0, new Breadcrumb(String.valueOf(bundle.getId()), bundle.getName())); + viewBundle(bundle, viewPath.getCurrent()); + CoreGUI.refreshBreadCrumbTrail(); } } else { + // Although still relevant the bundle is no longer being viewed. Set to 0 for re-fetch if needed + // also, destroy the current layout to make way for the new summary bundleBeingViewed = 0; - if (viewPath.getCurrent().getPath().equals("versions")) { - if (viewPath.isEnd()) { + this.destroyMembers();
- // versions list screen - } else { - // one version - removeMembers(getMembers()); + if (viewPath.getCurrent().getPath().equals("versions")) { + if (!viewPath.isEnd()) { + // a specific version BundleVersionView view = new BundleVersionView(extendLocatorId("Version")); addMember(view); view.renderView(viewPath.next()); } } else if (viewPath.getCurrent().getPath().equals("deployments")) { if (viewPath.isEnd()) { - - // versions list screen + // TODO: go to deployments tab for the bundle + // deployments list screen } else { - // one version - removeMembers(getMembers()); + // a specific deployment + //removeMembers(getMembers()); BundleDeploymentView view = new BundleDeploymentView(extendLocatorId("Deployment")); addMember(view); view.renderView(viewPath.next()); } } else if (viewPath.getCurrent().getPath().equals("destinations")) { - if (viewPath.isEnd()) { - - // versions list screen - } else { - // one version - removeMembers(getMembers()); - BundleDestinationView view = new BundleDestinationView(getLocatorId()); + if (!viewPath.isEnd()) { + // a specific destination + BundleDestinationView view = new BundleDestinationView(extendLocatorId("Destination")); addMember(view); view.renderView(viewPath.next()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 6f9d187..de63f77 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -70,6 +70,9 @@ public class BundleVersionView extends LocatableVLayout implements BookmarkableV }
public void viewBundleVersion(BundleVersion version, ViewId nextViewId) { + // Whenever a new view request comes in, make sure to clean house to avoid ID conflicts for sub-widgets + this.destroyMembers(); + this.version = version;
TabSet tabs = new LocatableTabSet(getLocatorId()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java index 3390716..c398661 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java @@ -25,7 +25,6 @@ package org.rhq.enterprise.gui.coregui.client.bundle.version.file; import java.util.List;
import com.google.gwt.user.client.rpc.AsyncCallback; -import com.smartgwt.client.widgets.grid.ListGrid; import com.smartgwt.client.widgets.grid.ListGridField; import com.smartgwt.client.widgets.grid.ListGridRecord;
@@ -55,8 +54,6 @@ public class FileListView extends LocatableVLayout {
Table table = new Table(extendLocatorId("BundleFiles"), "Bundle Files");
- ListGrid listGrid = table.getListGrid(); - ListGridField id = new ListGridField("id", "Id"); id.setWidth("20%");
@@ -66,11 +63,10 @@ public class FileListView extends LocatableVLayout { ListGridField size = new ListGridField("size", "File Size"); name.setWidth("20%");
- listGrid.setFields(id, name, size); - - listGrid.setData(buildRecords(files)); - - addMember(listGrid); + // To get the ListGrid the Table must be initialized (via onInit()) by adding to the Canvas + addMember(table); + table.getListGrid().setFields(id, name, size); + table.getListGrid().setData(buildRecords(files));
}
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java index 2891956..3d09ed8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/ReportTopView.java @@ -247,31 +247,31 @@ public class ReportTopView extends LocatableHLayout implements BookmarkableView if ("Inventory".equals(section)) {
if ("Tag Cloud".equals(page)) { - content = new TaggedView(extendLocatorId("TagCloud")); + content = new TaggedView(this.extendLocatorId("TagCloud")); } else if ("Suspect Metrics".equals(page)) { - content = new MeasurementOOBView(extendLocatorId("SuspectMetrics")); + content = new MeasurementOOBView(this.extendLocatorId("SuspectMetrics")); } else if ("Recent Configuration Changes".equals(page)) { - content = new ConfigurationHistoryView(extendLocatorId("RecentConfigChanges")); + content = new ConfigurationHistoryView(this.extendLocatorId("RecentConfigChanges")); } else if ("Recent Operations".equals(page)) { - content = new OperationHistoryView(extendLocatorId("RecentOps")); + content = new OperationHistoryView(this.extendLocatorId("RecentOps")); } else if ("Recent Alerts".equals(page)) { - content = new AlertsView(extendLocatorId("RecentAlerts")); + content = new AlertsView(this.extendLocatorId("RecentAlerts")); } else if ("Alert Definitions".equals(page)) { //todo } else if ("Platforms".equals(page)) { - content = new PlatformPortletView(extendLocatorId("Platforms")); + content = new PlatformPortletView(this.extendLocatorId("Platforms")); }
} else if ("Security".equals(section)) {
if ("Manage Users".equals(page)) { - content = new UsersView(extendLocatorId("Users")); + content = new UsersView(this.extendLocatorId("Users")); } else if ("Manage Roles".equals(page)) { - content = new RolesView(extendLocatorId("Roles")); + content = new RolesView(this.extendLocatorId("Roles")); } else if ("Auto Discovery Queue".equals(page)) { - content = new ResourceAutodiscoveryView(extendLocatorId("ADQ")); + content = new ResourceAutodiscoveryView(this.extendLocatorId("ADQ")); } else if ("Remote Agent Install".equals(page)) { - content = new RemoteAgentInstallView(); + content = new RemoteAgentInstallView(this.extendLocatorId("RemoteAgentInstall")); } } else if ("Configuration".equals(section)) {
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java index 00946ed..dd98c1c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableVLayout.java @@ -52,4 +52,8 @@ public class LocatableVLayout extends VLayout implements Locatable { return this.locatorId + "-" + extension; }
+ public void destroyMembers() { + SeleniumUtility.destroyMembers(this); + } + } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java index f6734c5..31d0f01 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/SeleniumUtility.java @@ -4,6 +4,7 @@ import com.google.gwt.user.client.ui.Hyperlink; import com.google.gwt.user.client.ui.UIObject; import com.smartgwt.client.widgets.BaseWidget; import com.smartgwt.client.widgets.Canvas; +import com.smartgwt.client.widgets.layout.Layout;
import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.util.message.Message; @@ -138,4 +139,16 @@ public class SeleniumUtility { static public boolean isUseDefaultIds() { return USE_DEFAULT_IDS; } + + /** + * Like Layout.removeMembers() but ensures a synchronous destroy of each member. + * @param <T> + * @param layout + */ + static public <T extends Layout> void destroyMembers(T layout) { + for (Canvas currentMember : layout.getMembers()) { + layout.removeMember(currentMember); + currentMember.destroy(); + } + } }
commit 0ca741124cb3214fa9ed4f3d377ee38aee94bb69 Merge: d171d06... a0529e9... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Aug 30 16:05:37 2010 -0400
Merge branch 'master' into master-jay
commit d171d06e0609473b4d086fe1e6d7a0df91e997b7 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Aug 30 16:04:26 2010 -0400
Selenium Work - merge fallout
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java index 8c2b42b..5b13ffd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java @@ -22,7 +22,6 @@ import java.util.EnumSet;
import com.google.gwt.user.client.rpc.AsyncCallback; import com.smartgwt.client.widgets.Window; -import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; @@ -35,15 +34,18 @@ import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class ConfigurationHistoryDetailView extends VLayout implements BookmarkableView { +public class ConfigurationHistoryDetailView extends LocatableVLayout implements BookmarkableView {
private int configurationUpdateId;
- public ConfigurationHistoryDetailView() { + public ConfigurationHistoryDetailView(String locatorId) { + super(locatorId); + setWidth100(); setHeight100(); } @@ -52,26 +54,25 @@ public class ConfigurationHistoryDetailView extends VLayout implements Bookmarka protected void onDraw() { super.onDraw();
- }
- private void displayHistory(final ResourceConfigurationUpdate update) {
ResourceTypeRepository.Cache.getInstance().getResourceTypes(update.getResource().getResourceType().getId(), - EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), - new ResourceTypeRepository.TypeLoadedCallback() { + EnumSet.of(ResourceTypeRepository.MetadataType.resourceConfigurationDefinition), + new ResourceTypeRepository.TypeLoadedCallback() {
- public void onTypesLoaded(ResourceType type) { + public void onTypesLoaded(ResourceType type) {
- ConfigurationDefinition definition = type.getResourceConfigurationDefinition(); + ConfigurationDefinition definition = type.getResourceConfigurationDefinition();
- ConfigurationEditor editor = new ConfigurationEditor(definition, update.getConfiguration()); - editor.setReadOnly(true); - addMember(editor); - markForRedraw(); - } - }); + ConfigurationEditor editor = new ConfigurationEditor("ResConfigHist-" + + update.getResource().getName(), definition, update.getConfiguration()); + editor.setReadOnly(true); + addMember(editor); + markForRedraw(); + } + }); }
public void displayInDialog() { @@ -98,20 +99,18 @@ public class ConfigurationHistoryDetailView extends VLayout implements Bookmarka criteria.fetchResource(true); criteria.addFilterId(updateId);
- GWTServiceLookup.getConfigurationService().findResourceConfigurationUpdatesByCriteria(criteria, - new AsyncCallback<PageList<ResourceConfigurationUpdate>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Unable to load configuration history", caught); - } - - public void onSuccess(PageList<ResourceConfigurationUpdate> result) { + new AsyncCallback<PageList<ResourceConfigurationUpdate>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Unable to load configuration history", caught); + }
- ResourceConfigurationUpdate update = result.get(0); - displayHistory(update); - } - }); + public void onSuccess(PageList<ResourceConfigurationUpdate> result) {
+ ResourceConfigurationUpdate update = result.get(0); + displayHistory(update); + } + });
} } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java index 1053e79..3339179 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java @@ -55,15 +55,12 @@ public class ConfigurationHistoryView extends TableSection { final ConfigurationHistoryDataSource datasource = new ConfigurationHistoryDataSource(); setDataSource(datasource);
- }
@Override protected void configureTable() { super.configureTable();
- - ListGrid grid = getListGrid();
grid.getField("id").setWidth(60); @@ -125,7 +122,6 @@ public class ConfigurationHistoryView extends TableSection { } });
- addTableAction(extendLocatorId("ShowDetail"), "Show Details", Table.SelectionEnablement.SINGLE, null, new TableAction() { public void executeAction(ListGridRecord[] selection) { @@ -140,14 +136,12 @@ public class ConfigurationHistoryView extends TableSection {
@Override public Canvas getDetailsView(int id) { - ConfigurationHistoryDetailView detailView = new ConfigurationHistoryDetailView(); + ConfigurationHistoryDetailView detailView = new ConfigurationHistoryDetailView(this.getLocatorId());
return detailView;
}
- - // -------- Static Utility loaders ------------
public static ConfigurationHistoryView getHistoryOf(String locatorId, int resourceId) {
commit fc503b6e857196403e25a7f49397d9f8f2e6e938 Merge: 8079c20... d9c6f5b... Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Aug 30 15:27:09 2010 -0400
Merge branch 'master' into master-jay
Conflicts: modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java
diff --cc modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java index ae049ce,0476dd1..83c5352 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java @@@ -50,7 -45,8 +45,7 @@@ public class ResourceTopView extends Lo setWidth100(); setHeight100();
- treeView = new ResourceTreeView(extendLocatorId("Tree")); - + treeView = new ResourceTreeView(getLocatorId()); addMember(treeView);
contentCanvas = new Canvas();
commit 8079c2034681ec7a089b868720bb00aa9f98117e Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Aug 30 15:10:46 2010 -0400
Selenium Work - More robust assignment for Dashboard and config edit
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java index 06004a0..9e27078 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/DemoCanvas.java @@ -92,16 +92,16 @@ public class DemoCanvas extends Canvas { topTabSet.removeTab(configTab); switch (x) { case 0: - configTab.setPane(new ConfigurationEditor(10005, 10060)); + configTab.setPane(new ConfigurationEditor("Case0", 10005, 10060)); break; case 1: - configTab.setPane(new ConfigurationEditor(10003, 10023)); + configTab.setPane(new ConfigurationEditor("Case1", 10003, 10023)); break; case 2: - configTab.setPane(new ConfigurationEditor(10002, 10022)); + configTab.setPane(new ConfigurationEditor("Case2", 10002, 10022)); break; case 3: - configTab.setPane(new ConfigurationEditor(10149, 10134)); + configTab.setPane(new ConfigurationEditor("Case3", 10149, 10134)); break; } topTabSet.addTab(configTab, 0); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java index 38a1f79..8d704be 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deploy/GetDeploymentConfigStep.java @@ -59,7 +59,7 @@ public class GetDeploymentConfigStep extends AbstractWizardStep { // otherwise, pop up the config editor to get the needed config Configuration startingConfig = (null == wizard.getLiveDeployment()) ? new Configuration() : getNormalizedLiveConfig(configDef); - editor = new ConfigurationEditor(configDef, startingConfig); + editor = new ConfigurationEditor("BundleDeploymentConfig", configDef, startingConfig); } }
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java index 6029ada..3f0d19f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/configuration/ConfigurationEditor.java @@ -77,7 +77,6 @@ import com.smartgwt.client.widgets.layout.LayoutSpacer; import com.smartgwt.client.widgets.layout.SectionStack; import com.smartgwt.client.widgets.layout.SectionStackSection; import com.smartgwt.client.widgets.layout.VLayout; -import com.smartgwt.client.widgets.menu.IMenuButton; import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuItem; import com.smartgwt.client.widgets.menu.MenuItemSeparator; @@ -115,6 +114,16 @@ import org.rhq.enterprise.gui.coregui.client.gwt.ConfigurationGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; import org.rhq.enterprise.gui.coregui.client.util.CanvasUtility; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableMenu; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableSectionStack; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTab; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTabSet; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableToolStrip; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTreeGrid; import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** @@ -125,7 +134,7 @@ public class ConfigurationEditor extends LocatableVLayout { private ConfigurationGWTServiceAsync configurationService = GWTServiceLookup.getConfigurationService();
private TabSet tabSet; - private ToolStrip toolStrip; + private LocatableToolStrip toolStrip;
private ConfigurationDefinition definition; private Configuration configuration; @@ -150,24 +159,24 @@ public class ConfigurationEditor extends LocatableVLayout {
; // Need this extra semicolon for the qdox parser
- public ConfigurationEditor() { - super("ConfigurationEditor"); + public ConfigurationEditor(String locatorId) { + super(locatorId); }
- public ConfigurationEditor(int resourceId, int resourceTypeId) { - this(resourceId, resourceTypeId, ConfigType.resource); + public ConfigurationEditor(String locatorId, int resourceId, int resourceTypeId) { + this(locatorId, resourceId, resourceTypeId, ConfigType.resource); }
- public ConfigurationEditor(int resourceId, int resourceTypeId, ConfigType configType) { - super("ConfigurationEditor"); + public ConfigurationEditor(String locatorId, int resourceId, int resourceTypeId, ConfigType configType) { + super(locatorId); this.resourceId = resourceId; this.resourceTypeId = resourceTypeId; this.configType = configType; setOverflow(Overflow.AUTO); }
- public ConfigurationEditor(ConfigurationDefinition definition, Configuration configuration) { - super("ConfigurationEditor"); + public ConfigurationEditor(String locatorId, ConfigurationDefinition definition, Configuration configuration) { + super(locatorId); this.configuration = configuration; this.definition = definition; } @@ -272,12 +281,12 @@ public class ConfigurationEditor extends LocatableVLayout {
originalConfiguration = configuration.deepCopy();
- tabSet = new TabSet(); + tabSet = new LocatableTabSet(getLocatorId());
if (definition.getConfigurationFormat() == ConfigurationFormat.RAW || definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED_AND_RAW) { System.out.println("Loading files view"); - Tab tab = new Tab("Files"); + Tab tab = new LocatableTab("Files", "Files"); tab.setPane(buildRawPane()); tabSet.addTab(tab); } @@ -285,7 +294,7 @@ public class ConfigurationEditor extends LocatableVLayout { if (definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED || definition.getConfigurationFormat() == ConfigurationFormat.STRUCTURED_AND_RAW) { System.out.println("loading properties view"); - Tab tab = new Tab("Properties"); + Tab tab = new LocatableTab("Properties", "Properties"); tab.setPane(buildStructuredPane()); tabSet.addTab(tab); } @@ -301,10 +310,10 @@ public class ConfigurationEditor extends LocatableVLayout {
protected HLayout buildRawPane() {
- HLayout layout = new HLayout(); + LocatableHLayout layout = new LocatableHLayout(extendLocatorId("Raw")); final HashMap<String, RawConfiguration> filesMap = new HashMap<String, RawConfiguration>();
- TreeGrid fileTree = new TreeGrid(); + TreeGrid fileTree = new LocatableTreeGrid(layout.extendLocatorId("Files")); fileTree.setShowResizeBar(true);
Tree files = new Tree(); @@ -321,7 +330,7 @@ public class ConfigurationEditor extends LocatableVLayout { fileTree.setData(files); fileTree.setWidth(250);
- DynamicForm form = new DynamicForm(); + DynamicForm form = new LocatableDynamicForm(layout.extendLocatorId("Editor")); final TextAreaItem rawEditor = new TextAreaItem(); // rawEditor.setValue("This is a test"); rawEditor.setShowTitle(false); @@ -350,10 +359,10 @@ public class ConfigurationEditor extends LocatableVLayout {
protected VLayout buildStructuredPane() {
- VLayout layout = new VLayout(); + LocatableVLayout layout = new LocatableVLayout(extendLocatorId("Structured")); List<PropertyGroupDefinition> definitions = definition.getGroupDefinitions();
- final SectionStack sectionStack = new SectionStack(); + final SectionStack sectionStack = new LocatableSectionStack(layout.extendLocatorId("Sections")); sectionStack.setVisibilityMode(VisibilityMode.MULTIPLE); sectionStack.setWidth100(); sectionStack.setHeight100(); @@ -361,15 +370,36 @@ public class ConfigurationEditor extends LocatableVLayout { sectionStack.setOverflow(Overflow.AUTO);
if (definition.getNonGroupedProperties().size() > 0) { - sectionStack.addSection(buildGroupSection(null)); + sectionStack.addSection(buildGroupSection(layout.extendLocatorId("NoGroup"), null)); }
for (PropertyGroupDefinition definition : definitions) { // System.out.println("building: " + definition.getDisplayName()); - sectionStack.addSection(buildGroupSection(definition)); + sectionStack.addSection(buildGroupSection(layout.extendLocatorId(definition.getName()), definition)); }
- Menu menu = new Menu(); + // TODO GH: Save button as saveListener() or remove the buttons from this form and have + // the container provide them? + + toolStrip = new LocatableToolStrip(layout.extendLocatorId("Tools")); + toolStrip.setBackgroundImage(null); + + toolStrip.setWidth100(); + + toolStrip.addMember(new LayoutSpacer()); + saveButton = new LocatableIButton(toolStrip.extendLocatorId("Save"), "Save"); + saveButton.setAlign(Alignment.CENTER); + saveButton.setDisabled(true); + // toolStrip.addMember(saveButton); + + IButton resetButton = new LocatableIButton(toolStrip.extendLocatorId("Reset"), "Reset"); + resetButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { + public void onClick(ClickEvent clickEvent) { + reload(); + } + }); + + Menu menu = new LocatableMenu(toolStrip.extendLocatorId("JumpMenu")); for (SectionStackSection section : sectionStack.getSections()) { MenuItem item = new MenuItem(section.getTitle()); item.addClickHandler(new ClickHandler() { @@ -381,7 +411,6 @@ public class ConfigurationEditor extends LocatableVLayout { }); menu.addItem(item); } - menu.addItem(new MenuItemSeparator());
MenuItem hideAllItem = new MenuItem("Hide All"); @@ -394,30 +423,9 @@ public class ConfigurationEditor extends LocatableVLayout { }); menu.addItem(hideAllItem);
- // TODO GH: Save button as saveListener() or remove the buttons from this form and have - // the container provide them? - - toolStrip = new ToolStrip(); - toolStrip.setBackgroundImage(null); - - toolStrip.setWidth100(); - - toolStrip.addMember(new LayoutSpacer()); - saveButton = new IButton("Save"); - saveButton.setAlign(Alignment.CENTER); - saveButton.setDisabled(true); - // toolStrip.addMember(saveButton); - - IButton resetButton = new IButton("Reset"); - resetButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { - public void onClick(ClickEvent clickEvent) { - reload(); - } - }); - // toolStrip.addMember(resetButton); toolStrip.addMember(new LayoutSpacer()); - toolStrip.addMember(new IMenuButton("Jump to Section", menu)); + toolStrip.addMember(new LocatableIMenuButton(toolStrip.extendLocatorId("Jump"), "Jump to Section", menu));
layout.addMember(toolStrip);
@@ -426,7 +434,7 @@ public class ConfigurationEditor extends LocatableVLayout { return layout; }
- public SectionStackSection buildGroupSection(PropertyGroupDefinition group) { + public SectionStackSection buildGroupSection(String locatorId, PropertyGroupDefinition group) {
SectionStackSection section; if (group == null) { @@ -447,14 +455,15 @@ public class ConfigurationEditor extends LocatableVLayout { .getNonGroupedProperties() : definition.getPropertiesInGroup(group.getName()))); Collections.sort(definitions, new PropertyDefinitionComparator());
- DynamicForm form = buildPropertiesForm(definitions, configuration); + DynamicForm form = buildPropertiesForm(locatorId, definitions, configuration);
section.addItem(form); return section; }
- private DynamicForm buildPropertiesForm(ArrayList<PropertyDefinition> definitions, AbstractPropertyMap propertyMap) { - DynamicForm form = new DynamicForm(); + private DynamicForm buildPropertiesForm(String locatorId, ArrayList<PropertyDefinition> definitions, + AbstractPropertyMap propertyMap) { + LocatableDynamicForm form = new LocatableDynamicForm(locatorId); form.setValuesManager(valuesManager); form.setValidateOnChange(true);
@@ -484,7 +493,7 @@ public class ConfigurationEditor extends LocatableVLayout { propertyMap.put(property); } } - addItems(fields, propertyDefinition, property, odd); + addItems(locatorId, fields, propertyDefinition, property, odd); odd = !odd; }
@@ -492,8 +501,8 @@ public class ConfigurationEditor extends LocatableVLayout { return form; }
- public void addItems(ArrayList<FormItem> fields, PropertyDefinition propertyDefinition, Property property, - boolean oddRow) { + public void addItems(String locatorId, ArrayList<FormItem> fields, PropertyDefinition propertyDefinition, + Property property, boolean oddRow) {
StaticTextItem nameItem = new StaticTextItem(); nameItem.setStartRow(true); @@ -520,8 +529,9 @@ public class ConfigurationEditor extends LocatableVLayout { } else if (propertyDefinition instanceof PropertyDefinitionList) { if (((PropertyDefinitionList) propertyDefinition).getMemberDefinition() instanceof PropertyDefinitionMap) { // List of Maps is a specially supported case with summary fields as columns in a table - buildListOfMapsField(fields, (PropertyDefinitionMap) ((PropertyDefinitionList) propertyDefinition) - .getMemberDefinition(), oddRow, (PropertyList) property); + buildListOfMapsField(locatorId, fields, + (PropertyDefinitionMap) ((PropertyDefinitionList) propertyDefinition).getMemberDefinition(), + oddRow, (PropertyList) property); } } else if (propertyDefinition instanceof PropertyDefinitionMap) { buildMapsField(fields, (PropertyDefinitionMap) propertyDefinition, (PropertyMap) property); @@ -568,8 +578,8 @@ public class ConfigurationEditor extends LocatableVLayout {
}
- private void buildListOfMapsField(ArrayList<FormItem> fields, final PropertyDefinitionMap propertyDefinition, - boolean oddRow, final PropertyList propertyList) { + private void buildListOfMapsField(final String locatorId, ArrayList<FormItem> fields, + final PropertyDefinitionMap propertyDefinition, boolean oddRow, final PropertyList propertyList) {
final ListGrid summaryTable = new ListGrid(); // summaryTable.setID("config_summaryTable_" + propertyDefinition.getName()); @@ -625,8 +635,8 @@ public class ConfigurationEditor extends LocatableVLayout { editField.addRecordClickHandler(new RecordClickHandler() { public void onRecordClick(RecordClickEvent recordClickEvent) { System.out.println("You want to edit: " + recordClickEvent.getRecord()); - displayMapEditor(summaryTable, recordClickEvent.getRecord(), propertyDefinition, propertyList, - (PropertyMap) recordClickEvent.getRecord().getAttributeAsObject("_RHQ_PROPERTY")); + displayMapEditor(locatorId, summaryTable, recordClickEvent.getRecord(), propertyDefinition, + propertyList, (PropertyMap) recordClickEvent.getRecord().getAttributeAsObject("_RHQ_PROPERTY")); } }); fieldsList.add(editField); @@ -673,7 +683,7 @@ public class ConfigurationEditor extends LocatableVLayout { addRowButton.setIcon(Window.getImgURL("[SKIN]/actions/add.png")); addRowButton.addClickHandler(new com.smartgwt.client.widgets.events.ClickHandler() { public void onClick(ClickEvent clickEvent) { - displayMapEditor(summaryTable, null, propertyDefinition, propertyList, null); + displayMapEditor(locatorId, summaryTable, null, propertyDefinition, propertyList, null); } });
@@ -889,7 +899,7 @@ public class ConfigurationEditor extends LocatableVLayout { return valueItem; }
- private void displayMapEditor(final ListGrid summaryTable, final Record existingRecord, + private void displayMapEditor(String locatorId, final ListGrid summaryTable, final Record existingRecord, PropertyDefinitionMap definition, final PropertyList list, PropertyMap map) {
final ArrayList<PropertyDefinition> definitions = new ArrayList<PropertyDefinition>(definition @@ -904,10 +914,10 @@ public class ConfigurationEditor extends LocatableVLayout { final PropertyMap finalMap = map; final PropertyMap copy = finalMap.deepCopy(true);
- VLayout layout = new VLayout(); + LocatableVLayout layout = new LocatableVLayout(); layout.setHeight100();
- DynamicForm childForm = buildPropertiesForm(definitions, finalMap); + DynamicForm childForm = buildPropertiesForm(locatorId, definitions, finalMap); childForm.setHeight100(); layout.addMember(childForm);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java index 6563552..f4b3cad 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardView.java @@ -33,7 +33,6 @@ import com.smartgwt.client.widgets.form.fields.TextItem; import com.smartgwt.client.widgets.form.fields.events.ChangedEvent; import com.smartgwt.client.widgets.form.fields.events.ChangedHandler; import com.smartgwt.client.widgets.layout.LayoutSpacer; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.menu.IMenuButton; import com.smartgwt.client.widgets.menu.Menu; import com.smartgwt.client.widgets.menu.MenuItem; @@ -46,11 +45,14 @@ import org.rhq.core.domain.dashboard.DashboardPortlet; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableDynamicForm; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIMenuButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class DashboardView extends VLayout { +public class DashboardView extends LocatableVLayout {
private DashboardsView dashboardsView; private Dashboard storedDashboard; @@ -63,8 +65,9 @@ public class DashboardView extends VLayout {
HashSet<PortletWindow> portlets = new HashSet<PortletWindow>();
+ public DashboardView(String locatorId, DashboardsView dashboardsView, Dashboard storedDashboard) { + super(locatorId);
- public DashboardView(DashboardsView dashboardsView, Dashboard storedDashboard) { this.dashboardsView = dashboardsView; this.storedDashboard = storedDashboard; setOverflow(Overflow.AUTO); @@ -97,27 +100,24 @@ public class DashboardView extends VLayout {
setBackgroundColor(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND, "white"));
- portalLayout = new PortalLayout(this, storedDashboard.getColumns()); + portalLayout = new PortalLayout(extendLocatorId("PortalLayout"), this, storedDashboard.getColumns()); portalLayout.setWidth100(); portalLayout.setHeight100();
- loadPortlets();
- addMember(editForm); editForm.hide(); addMember(portalLayout);
}
- private DynamicForm buildEditForm() { - editForm = new DynamicForm(); + editForm = new LocatableDynamicForm(extendLocatorId("Editor")); editForm.setAutoWidth(); editForm.setNumCols(9);
- TextItem nameItem = new TextItem("name","Dashboard Name"); + TextItem nameItem = new TextItem("name", "Dashboard Name"); nameItem.setValue(storedDashboard.getName()); nameItem.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent changedEvent) { @@ -132,12 +132,11 @@ public class DashboardView extends VLayout { numColItem.setValue(storedDashboard.getColumns());
ButtonItem addColumn = new ButtonItem("addColumn", "Add Column"); -// addColumn.setIcon("silk/application_side_expand.png"); + // addColumn.setIcon("silk/application_side_expand.png"); addColumn.setAutoFit(true); addColumn.setStartRow(false); addColumn.setEndRow(false);
- addColumn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) { portalLayout.addMember(new PortalColumn()); @@ -148,12 +147,11 @@ public class DashboardView extends VLayout { });
ButtonItem removeColumn = new ButtonItem("removeColumn", "Remove Column"); -// removeColumn.setIcon("silk/application_side_contract.png"); + // removeColumn.setIcon("silk/application_side_contract.png"); removeColumn.setAutoFit(true); removeColumn.setStartRow(false); removeColumn.setEndRow(false);
- removeColumn.addClickHandler(new com.smartgwt.client.widgets.form.fields.events.ClickHandler() { public void onClick(com.smartgwt.client.widgets.form.fields.events.ClickEvent event) {
@@ -170,24 +168,21 @@ public class DashboardView extends VLayout { } });
- - - Menu addPorletMenu = new Menu(); for (String portletName : PortletFactory.getRegisteredPortlets()) { addPorletMenu.addItem(new MenuItem(portletName)); }
- addPortlet = new IMenuButton("Add Portlet", addPorletMenu); + addPortlet = new LocatableIMenuButton(extendLocatorId("AddPortal"), "Add Portlet", addPorletMenu);
-// addPortlet = new ButtonItem("addPortlet", "Add Portlet"); + // addPortlet = new ButtonItem("addPortlet", "Add Portlet"); addPortlet.setIcon("[skin]/images/actions/add.png"); addPortlet.setAutoFit(true);
addPorletMenu.addItemClickHandler(new ItemClickHandler() { public void onItemClick(ItemClickEvent itemClickEvent) { - String portalTitle = itemClickEvent.getItem().getTitle(); - addPortlet(portalTitle); + String portletTitle = itemClickEvent.getItem().getTitle(); + addPortlet(portletTitle, portletTitle); } });
@@ -198,32 +193,31 @@ public class DashboardView extends VLayout { addCanvas.setEndRow(false);
ColorPickerItem picker = new ColorPickerItem(); - + picker.setTitle("Background"); picker.addChangedHandler(new ChangedHandler() { public void onChanged(ChangedEvent changedEvent) { Object v = changedEvent.getValue(); System.out.println("color chagned to " + v); setBackgroundColor(String.valueOf(v)); - storedDashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND,String.valueOf(v))); + storedDashboard.getConfiguration().put(new PropertySimple(Dashboard.CFG_BACKGROUND, String.valueOf(v))); save(); } }); - picker.setValue(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND,"white")); - + picker.setValue(storedDashboard.getConfiguration().getSimpleValue(Dashboard.CFG_BACKGROUND, "white"));
editForm.setItems(nameItem, numColItem, addCanvas, picker, addColumn, removeColumn); return editForm; }
- private void loadPortlets() {
int col = 0; for (int i = 0; i < storedDashboard.getColumns(); i++) {
for (DashboardPortlet storedPortlet : storedDashboard.getPortlets(i)) { - final PortletWindow portlet = new PortletWindow(this, storedPortlet); + final PortletWindow portlet = new PortletWindow(extendLocatorId(storedPortlet.getPortletKey()), this, + storedPortlet); portlets.add(portlet); portlet.setTitle(storedPortlet.getName());
@@ -237,29 +231,25 @@ public class DashboardView extends VLayout { } }
+ private void addPortlet(String portletKey, String portletName) { + DashboardPortlet storedPortlet = new DashboardPortlet(portletName, portletKey, 250);
- private void addPortlet(String portletName) { - DashboardPortlet storedPortlet = new DashboardPortlet(portletName, portletName, 250); - - final PortletWindow newPortlet = new PortletWindow(this, storedPortlet); + final PortletWindow newPortlet = new PortletWindow(extendLocatorId(portletKey), this, storedPortlet); portlets.add(newPortlet);
- storedDashboard.addPortlet(storedPortlet, 0, 0);
newPortlet.setTitle(portletName);
- newPortlet.setHeight(350); newPortlet.setVisible(false);
- PortalColumn column = portalLayout.addPortlet(newPortlet, 0);
// also insert a blank spacer element, which will trigger the built-in // animateMembers layout animation final LayoutSpacer placeHolder = new LayoutSpacer(); -// placeHolder.setRect(newPortlet.getRect()); + // placeHolder.setRect(newPortlet.getRect()); column.addMember(placeHolder); // add to top
// create an outline around the clicked button @@ -272,16 +262,15 @@ public class DashboardView extends VLayout { outline.draw(); outline.bringToFront();
- outline.animateRect(newPortlet.getPageLeft(), newPortlet.getPageTop(), - newPortlet.getVisibleWidth(), newPortlet.getViewportHeight(), - new AnimationCallback() { - public void execute(boolean earlyFinish) { - // callback at end of animation - destroy placeholder and outline; show the new portlet - placeHolder.destroy(); - outline.destroy(); - newPortlet.show(); - } - }, 750); + outline.animateRect(newPortlet.getPageLeft(), newPortlet.getPageTop(), newPortlet.getVisibleWidth(), newPortlet + .getViewportHeight(), new AnimationCallback() { + public void execute(boolean earlyFinish) { + // callback at end of animation - destroy placeholder and outline; show the new portlet + placeHolder.destroy(); + outline.destroy(); + newPortlet.show(); + } + }, 750); save(); }
@@ -292,7 +281,8 @@ public class DashboardView extends VLayout { }
public void onSuccess(Dashboard result) { - CoreGUI.getMessageCenter().notify(new Message("Saved dashboard " + result.getName() + " to server", Message.Severity.Info)); + CoreGUI.getMessageCenter().notify( + new Message("Saved dashboard " + result.getName() + " to server", Message.Severity.Info)); storedDashboard = result;
updateConfigs(result); @@ -317,7 +307,8 @@ public class DashboardView extends VLayout { }
public void onSuccess(Void result) { - CoreGUI.getMessageCenter().notify(new Message("Successfully deleted dashboard " + storedDashboard.getName(), Message.Severity.Info)); + CoreGUI.getMessageCenter().notify( + new Message("Successfully deleted dashboard " + storedDashboard.getName(), Message.Severity.Info)); } }); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java index 5bf7fbd..dba1098 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/DashboardsView.java @@ -55,6 +55,9 @@ import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MashupPortl import org.rhq.enterprise.gui.coregui.client.dashboard.portlets.util.MessagePortlet; import org.rhq.enterprise.gui.coregui.client.gwt.DashboardGWTServiceAsync; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTab; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableTabSet; import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** @@ -107,14 +110,14 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView removeMembers(getMembers()); this.dashboards = dashboards;
- tabSet = new TabSet(); + tabSet = new LocatableTabSet(getLocatorId());
tabSet.setWidth100(); tabSet.setHeight100();
tabSet.setCanCloseTabs(true);
- editButton = new IButton(editMode ? "View Mode" : "Edit Mode"); + editButton = new LocatableIButton(extendLocatorId("Mode"), editMode ? "View Mode" : "Edit Mode"); editButton.setAutoFit(true); editButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { @@ -124,7 +127,7 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView } });
- final IButton newDashboardButton = new IButton("New Dashboard"); + final IButton newDashboardButton = new LocatableIButton(extendLocatorId("New"), "New Dashboard"); newDashboardButton.setAutoFit(true); newDashboardButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { @@ -148,9 +151,9 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView });
for (Dashboard dashboard : dashboards) { - DashboardView dashboardView = new DashboardView(this, dashboard); + DashboardView dashboardView = new DashboardView(extendLocatorId(dashboard.getName()), this, dashboard);
- Tab tab = new Tab(dashboard.getName()); + Tab tab = new LocatableTab(dashboard.getName(), dashboard.getName()); tab.setPane(dashboardView); tab.setCanClose(true);
@@ -255,9 +258,10 @@ public class DashboardsView extends LocatableVLayout implements BookmarkableView }
public void onSuccess(Dashboard result) { - DashboardView dashboardView = new DashboardView(DashboardsView.this, result); + DashboardView dashboardView = new DashboardView(extendLocatorId(result.getName()), DashboardsView.this, + result);
- Tab tab = new Tab(result.getName()); + Tab tab = new LocatableTab(extendLocatorId(result.getName()), result.getName()); tab.setPane(dashboardView); tab.setCanClose(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java index 0a5a1e6..8a3d355 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortalLayout.java @@ -26,18 +26,19 @@ import com.smartgwt.client.util.EventHandler; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.events.DropEvent; import com.smartgwt.client.widgets.events.DropHandler; -import com.smartgwt.client.widgets.layout.HLayout;
import org.rhq.core.domain.dashboard.DashboardPortlet; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHLayout;
/** * @author Greg Hinkle */ -public class PortalLayout extends HLayout { +public class PortalLayout extends LocatableHLayout {
private DashboardView dashboardView;
- public PortalLayout(DashboardView dashboardView, int numColumns) { + public PortalLayout(String locatorId, DashboardView dashboardView, int numColumns) { + super(locatorId);
this.dashboardView = dashboardView;
@@ -49,9 +50,6 @@ public class PortalLayout extends HLayout { } addMember(column);
- - - final int columnNumber = i; column.addDropHandler(new DropHandler() { public void onDrop(DropEvent dropEvent) { @@ -59,7 +57,6 @@ public class PortalLayout extends HLayout { int dropPosition = column.getDropPosition(); int dropColumn = columnNumber;
- Canvas target = EventHandler.getDragTarget(); ((PortletWindow) target).getDashboardPortlet().setIndex(dropPosition); ((PortletWindow) target).getDashboardPortlet().setColumn(dropColumn); @@ -69,7 +66,6 @@ public class PortalLayout extends HLayout {
PortalColumn pc = (PortalColumn) pcc;
- int i = 0; for (Canvas c : pc.getMembers()) { if (colNum == dropColumn && i == dropPosition) { @@ -106,7 +102,6 @@ public class PortalLayout extends HLayout { return fewestPortletsColumn; }
- public PortalColumn addPortlet(PortletWindow portlet, int column) { PortalColumn fewestPortletsColumn = (PortalColumn) getMember(column);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java index b68ab67..22227f6 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletSettingsWindow.java @@ -29,7 +29,6 @@ import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.Label; -import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.form.DynamicForm; @@ -40,6 +39,8 @@ import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; import org.rhq.core.domain.dashboard.DashboardPortlet; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
/** * This is a window for displaying portlet settings. The window contains a form which in turn will contain the @@ -51,13 +52,15 @@ import org.rhq.enterprise.gui.coregui.client.components.configuration.Configurat * * @author John Sanda */ -public class PortletSettingsWindow extends Window { +public class PortletSettingsWindow extends LocatableWindow {
private PortletWindow parentWindow; private DashboardPortlet storedPortlet; private Portlet view;
- public PortletSettingsWindow(PortletWindow parentWindow, DashboardPortlet storedPortlet, Portlet view) { + public PortletSettingsWindow(String locatorId, PortletWindow parentWindow, DashboardPortlet storedPortlet, + Portlet view) { + super(locatorId); this.parentWindow = parentWindow; this.storedPortlet = storedPortlet; this.view = view; @@ -70,7 +73,6 @@ public class PortletSettingsWindow extends Window { setCanDragResize(true); setCanDragReposition(true);
- }
@Override @@ -84,18 +86,17 @@ public class PortletSettingsWindow extends Window { layout.setLayoutMargin(20); layout.setVPolicy(LayoutPolicy.FILL);
- if (view instanceof CustomSettingsPortlet) { final DynamicForm form = ((CustomSettingsPortlet) view).getCustomSettingsForm(); layout.addMember(form);
- IButton cancel = new IButton("Cancel"); + IButton cancel = new LocatableIButton(this.extendLocatorId("Cancel"), "Cancel"); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { PortletSettingsWindow.this.destroy(); } }); - IButton save = new IButton("Save"); + IButton save = new LocatableIButton(this.extendLocatorId("Save"), "Save"); save.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { if (form.validate()) { @@ -119,19 +120,18 @@ public class PortletSettingsWindow extends Window { ConfigurationDefinition definition = ((ConfigurablePortlet) view).getConfigurationDefinition(); Configuration configuration = storedPortlet.getConfiguration();
- final ConfigurationEditor editor = new ConfigurationEditor(definition, configuration); + final ConfigurationEditor editor = new ConfigurationEditor(getLocatorId(), definition, configuration); editor.setWidth(400); editor.setHeight(400); layout.addMember(editor);
- - IButton cancel = new IButton("Cancel"); + IButton cancel = new LocatableIButton(this.extendLocatorId("Cancel"), "Cancel"); cancel.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { PortletSettingsWindow.this.destroy(); } }); - IButton save = new IButton("Save"); + IButton save = new LocatableIButton(this.extendLocatorId("Save"), "Save"); save.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { if (editor.validate()) { @@ -139,7 +139,7 @@ public class PortletSettingsWindow extends Window { storedPortlet.setConfiguration(configuration); PortletSettingsWindow.this.destroy(); view.configure(parentWindow, storedPortlet); -// ((Canvas) view).markForRedraw(); + // ((Canvas) view).markForRedraw(); parentWindow.markForRedraw(); parentWindow.save(); } @@ -152,14 +152,11 @@ public class PortletSettingsWindow extends Window { buttons.addMember(save); layout.addMember(buttons);
- } else { layout.addMember(new Label("No settings available for this portlet")); }
- addItem(layout); }
- } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java index 395d0c9..457b75d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/dashboard/PortletWindow.java @@ -27,7 +27,6 @@ import com.smartgwt.client.types.HeaderControls; import com.smartgwt.client.types.Overflow; import com.smartgwt.client.widgets.Canvas; import com.smartgwt.client.widgets.HeaderControl; -import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.events.CloseClickHandler; @@ -37,11 +36,13 @@ import com.smartgwt.client.widgets.events.DragResizeStopHandler;
import org.rhq.core.domain.dashboard.DashboardPortlet; import org.rhq.enterprise.gui.coregui.client.components.table.Table; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableHeaderControl; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableWindow;
/** * @author Greg Hinkle */ -public class PortletWindow extends Window { +public class PortletWindow extends LocatableWindow {
private DashboardView dashboardView; private DashboardPortlet dashboardPortlet; @@ -72,33 +73,29 @@ public class PortletWindow extends Window { private ClickHandler refreshHandler = new ClickHandler() { public void onClick(ClickEvent clickEvent) { if (PortletWindow.this.view instanceof Table) { - ((Table)PortletWindow.this.view).refresh(); + ((Table) PortletWindow.this.view).refresh(); } else { - ((Canvas)PortletWindow.this.view).redraw(); + ((Canvas) PortletWindow.this.view).redraw(); } } };
- public PortletWindow(DashboardView dashboardView, DashboardPortlet dashboardPortlet) { + public PortletWindow(String locatorId, DashboardView dashboardView, DashboardPortlet dashboardPortlet) { + super(locatorId);
this.dashboardView = dashboardView; this.dashboardPortlet = dashboardPortlet; setEdgeSize(2);
- -// if (!showFrame) { -// setShowHeader(false); -// setShowEdges(false); + // if (!showFrame) { + // setShowHeader(false); + // setShowEdges(false);
// customize the appearance and order of the controls in the window header - setHeaderControls( - HeaderControls.MINIMIZE_BUTTON, - HeaderControls.HEADER_LABEL, - new HeaderControl(HeaderControl.REFRESH, refreshHandler), - new HeaderControl(HeaderControl.SETTINGS, settingsHandler), - new HeaderControl(HeaderControl.HELP, helpHandler), - HeaderControls.CLOSE_BUTTON - ); + setHeaderControls(HeaderControls.MINIMIZE_BUTTON, HeaderControls.HEADER_LABEL, new LocatableHeaderControl( + extendLocatorId("Refresh"), HeaderControl.REFRESH, refreshHandler), new LocatableHeaderControl( + extendLocatorId("Settings"), HeaderControl.SETTINGS, settingsHandler), new LocatableHeaderControl( + extendLocatorId("Help"), HeaderControl.HELP, helpHandler), HeaderControls.CLOSE_BUTTON);
// show either a shadow, or translucency, when dragging a portlet // (could do both at the same time, but these are not visually compatible effects) @@ -114,22 +111,19 @@ public class PortletWindow extends Window { setCanDrop(true);
setCanDragResize(true); -// setResizeFrom("B"); - + // setResizeFrom("B");
setShowShadow(false);
// these settings enable the portlet to autosize its height only to fit its contents // (since width is determined from the containing layout, not the portlet contents) -// setVPolicy(LayoutPolicy.NONE); + // setVPolicy(LayoutPolicy.NONE); setOverflow(Overflow.VISIBLE);
- addDragResizeStopHandler(new DragResizeStopHandler() { public void onDragResizeStop(DragResizeStopEvent dragResizeStopEvent) {
- - PortletWindow.this.dashboardPortlet.setHeight(((Canvas) dragResizeStopEvent.getSource()).getHeight()); + PortletWindow.this.dashboardPortlet.setHeight(((Canvas) dragResizeStopEvent.getSource()).getHeight());
PortletWindow.this.dashboardView.resize(); save(); @@ -161,7 +155,8 @@ public class PortletWindow extends Window {
settingsHandlerDelegate = new ClickHandler() { public void onClick(ClickEvent clickEvent) { - new PortletSettingsWindow(PortletWindow.this, dashboardPortlet, view).show(); + new PortletSettingsWindow(extendLocatorId("Settings"), PortletWindow.this, dashboardPortlet, view) + .show(); } };
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java index e16f7a0..5edd16d 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/NewResourceTreeView.java @@ -199,8 +199,8 @@ public class NewResourceTreeView extends LocatableVLayout { configEditor.setShowModalMask(true); configEditor.setCanDragResize(true); configEditor.centerInPage(); - configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, - ConfigurationEditor.ConfigType.plugin)); + configEditor.addItem(new ConfigurationEditor("PluginConfig-" + resource.getName(), resourceId, + resourceTypeId, ConfigurationEditor.ConfigType.plugin)); configEditor.show();
} @@ -228,8 +228,8 @@ public class NewResourceTreeView extends LocatableVLayout { configEditor.destroy(); } }); - configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, - ConfigurationEditor.ConfigType.resource)); + configEditor.addItem(new ConfigurationEditor("ResourceConfig-" + resource.getName(), resourceId, + resourceTypeId, ConfigurationEditor.ConfigType.resource)); configEditor.show();
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index 67feee5..e6b57cf 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -236,7 +236,7 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable monitoringTab.updateSubTab(this.monitorCallTime);
this.inventoryChildren.setCanvas(ResourceSearchView.getChildrenOf(resource.getId())); - this.inventoryConn.setCanvas(new PluginConfigurationEditView(resource)); + this.inventoryConn.setCanvas(new PluginConfigurationEditView(this.extendLocatorId("PluginConfig"), resource)); inventoryTab.updateSubTab(this.inventoryChildren); inventoryTab.updateSubTab(this.inventoryConn);
@@ -269,7 +269,8 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable alertsTab.updateSubTab(this.alertDef); alertsTab.updateSubTab(this.alertDelete);
- this.configCurrent.setCanvas(new ResourceConfigurationEditView(resource)); + this.configCurrent + .setCanvas(new ResourceConfigurationEditView(this.extendLocatorId("ResourceConfig"), resource)); this.configHistory.setCanvas(ConfigurationHistoryView.getHistoryOf(configurationTab.extendLocatorId("Hist"), resource.getId())); configurationTab.updateSubTab(this.configCurrent); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java index 8762576..e73c7ef 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTreeView.java @@ -243,8 +243,8 @@ public class ResourceTreeView extends LocatableVLayout { configEditor.setShowModalMask(true); configEditor.setCanDragResize(true); configEditor.centerInPage(); - configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, - ConfigurationEditor.ConfigType.plugin)); + configEditor.addItem(new ConfigurationEditor("PluginConfig-" + resource.getName(), resourceId, + resourceTypeId, ConfigurationEditor.ConfigType.plugin)); configEditor.show();
} @@ -272,8 +272,8 @@ public class ResourceTreeView extends LocatableVLayout { configEditor.destroy(); } }); - configEditor.addItem(new ConfigurationEditor(resourceId, resourceTypeId, - ConfigurationEditor.ConfigType.resource)); + configEditor.addItem(new ConfigurationEditor("ResourceConfig-" + resource.getName(), resourceId, + resourceTypeId, ConfigurationEditor.ConfigType.resource)); configEditor.show();
} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java index b033a40..109a4f7 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryDetailView.java @@ -18,25 +18,25 @@ */ package org.rhq.enterprise.gui.coregui.client.inventory.resource.detail.configuration;
-import java.util.EnumSet; - import com.smartgwt.client.widgets.Window; -import com.smartgwt.client.widgets.layout.Layout;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.definition.ConfigurationDefinition; -import org.rhq.core.domain.resource.ResourceType; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; -import org.rhq.enterprise.gui.coregui.client.inventory.resource.type.ResourceTypeRepository; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableLayout;
/** * @author Greg Hinkle */ -public class ConfigurationHistoryDetailView extends Layout { +public class ConfigurationHistoryDetailView extends LocatableLayout {
private ConfigurationDefinition definition; private Configuration configuration;
+ public ConfigurationHistoryDetailView(String locatorId) { + super(locatorId); + } + @Override protected void onDraw() { super.onDraw(); @@ -52,12 +52,11 @@ public class ConfigurationHistoryDetailView extends Layout { setup(); }
- private void setup() { if (getChildren().length > 0) getChildren()[0].destroy();
- ConfigurationEditor editor = new ConfigurationEditor(definition, configuration); + ConfigurationEditor editor = new ConfigurationEditor(getLocatorId(), definition, configuration); editor.setReadOnly(true); addMember(editor); markForRedraw(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java index 8351278..4fc352f 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java @@ -168,7 +168,8 @@ public class ConfigurationHistoryView extends LocatableVLayout {
ConfigurationDefinition definition = type.getResourceConfigurationDefinition();
- ConfigurationHistoryDetailView detailView = new ConfigurationHistoryDetailView(); + ConfigurationHistoryDetailView detailView = new ConfigurationHistoryDetailView("ResConfigHist-" + + update.getResource().getName());
detailView.setConfiguration(definition, update.getConfiguration());
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java index c939492..a0df3e9 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ResourceConfigurationEditView.java @@ -24,7 +24,6 @@ import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.LayoutSpacer; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.configuration.Configuration; @@ -34,21 +33,23 @@ import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class ResourceConfigurationEditView extends VLayout { - +public class ResourceConfigurationEditView extends LocatableVLayout {
Resource resource; ConfigurationEditor editor;
- public ResourceConfigurationEditView(Resource resource) { + public ResourceConfigurationEditView(String locatorId, Resource resource) { + super(locatorId); + this.resource = resource; }
- @Override protected void onDraw() { super.onDraw(); @@ -62,20 +63,18 @@ public class ResourceConfigurationEditView extends VLayout {
toolStrip.addMember(new LayoutSpacer());
- IButton saveButton = new IButton("Save"); + IButton saveButton = new LocatableIButton(this.extendLocatorId("Save"), "Save"); saveButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { save(); } }); -// saveButton.disable(); + // saveButton.disable(); toolStrip.addMember(saveButton);
- - editor = new ConfigurationEditor(resource.getId(), resource.getResourceType().getId()); + editor = new ConfigurationEditor(this.getLocatorId(), resource.getId(), resource.getResourceType().getId()); editor.setOverflow(Overflow.AUTO);
- addMember(toolStrip);
addMember(editor); @@ -84,19 +83,19 @@ public class ResourceConfigurationEditView extends VLayout { private void save() { Configuration updatedConfiguration = editor.getConfiguration();
+ GWTServiceLookup.getConfigurationService().updateResourceConfiguration(resource.getId(), updatedConfiguration, + new AsyncCallback<ResourceConfigurationUpdate>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update configuration", caught); + }
- GWTServiceLookup.getConfigurationService().updateResourceConfiguration( - resource.getId(), updatedConfiguration, new AsyncCallback<ResourceConfigurationUpdate>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update configuration",caught); - } - - public void onSuccess(ResourceConfigurationUpdate result) { - CoreGUI.getMessageCenter().notify(new Message("Configuration updated for resource [" + resource.getName() + "]", Message.Severity.Info)); + public void onSuccess(ResourceConfigurationUpdate result) { + CoreGUI.getMessageCenter().notify( + new Message("Configuration updated for resource [" + resource.getName() + "]", + Message.Severity.Info));
- } } - ); + });
} } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java index 715b0ed..c11cca2 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/inventory/PluginConfigurationEditView.java @@ -24,32 +24,32 @@ import com.smartgwt.client.widgets.IButton; import com.smartgwt.client.widgets.events.ClickEvent; import com.smartgwt.client.widgets.events.ClickHandler; import com.smartgwt.client.widgets.layout.LayoutSpacer; -import com.smartgwt.client.widgets.layout.VLayout; import com.smartgwt.client.widgets.toolbar.ToolStrip;
import org.rhq.core.domain.configuration.Configuration; import org.rhq.core.domain.configuration.PluginConfigurationUpdate; -import org.rhq.core.domain.configuration.ResourceConfigurationUpdate; import org.rhq.core.domain.resource.Resource; import org.rhq.enterprise.gui.coregui.client.CoreGUI; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; import org.rhq.enterprise.gui.coregui.client.util.message.Message; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableIButton; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class PluginConfigurationEditView extends VLayout { - +public class PluginConfigurationEditView extends LocatableVLayout {
private Resource resource; private ConfigurationEditor editor;
- public PluginConfigurationEditView(Resource resource) { + public PluginConfigurationEditView(String locatorId, Resource resource) { + super(locatorId); + this.resource = resource; }
- @Override protected void onDraw() { super.onDraw(); @@ -63,20 +63,19 @@ public class PluginConfigurationEditView extends VLayout {
toolStrip.addMember(new LayoutSpacer());
- IButton saveButton = new IButton("Save"); + IButton saveButton = new LocatableIButton(this.extendLocatorId("Save"), "Save"); saveButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { save(); } }); -// saveButton.disable(); + // saveButton.disable(); toolStrip.addMember(saveButton);
- - editor = new ConfigurationEditor(resource.getId(), resource.getResourceType().getId(), ConfigurationEditor.ConfigType.plugin); + editor = new ConfigurationEditor(this.getLocatorId(), resource.getId(), resource.getResourceType().getId(), + ConfigurationEditor.ConfigType.plugin); editor.setOverflow(Overflow.AUTO);
- addMember(toolStrip);
addMember(editor); @@ -85,19 +84,19 @@ public class PluginConfigurationEditView extends VLayout { private void save() { Configuration updatedConfiguration = editor.getConfiguration();
+ GWTServiceLookup.getConfigurationService().updatePluginConfiguration(resource.getId(), updatedConfiguration, + new AsyncCallback<PluginConfigurationUpdate>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failed to update configuration", caught); + }
- GWTServiceLookup.getConfigurationService().updatePluginConfiguration( - resource.getId(), updatedConfiguration, new AsyncCallback<PluginConfigurationUpdate>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failed to update configuration",caught); - } - - public void onSuccess(PluginConfigurationUpdate result) { - CoreGUI.getMessageCenter().notify(new Message("Connection settings updated for resource [" + resource.getName() + "]", Message.Severity.Info)); + public void onSuccess(PluginConfigurationUpdate result) { + CoreGUI.getMessageCenter().notify( + new Message("Connection settings updated for resource [" + resource.getName() + "]", + Message.Severity.Info));
- } } - ); + });
} } \ No newline at end of file diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java index e4c7d53..e32b2fd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/create/OperationParametersStep.java @@ -48,7 +48,8 @@ public class OperationParametersStep extends AbstractWizardStep { Configuration defaultConfiguration = configurationDefinition.getDefaultTemplate() != null ? configurationDefinition .getDefaultTemplate().createConfiguration() : new Configuration(); - configurationEditor = new ConfigurationEditor(configurationDefinition, defaultConfiguration); + configurationEditor = new ConfigurationEditor("OperationParams", configurationDefinition, + defaultConfiguration); } return configurationEditor; } else { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/detail/OperationDetailsView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/detail/OperationDetailsView.java index 7206815..e316105 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/detail/OperationDetailsView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/operation/detail/OperationDetailsView.java @@ -27,7 +27,6 @@ import com.smartgwt.client.widgets.Window; import com.smartgwt.client.widgets.form.DynamicForm; import com.smartgwt.client.widgets.form.fields.AutoFitTextAreaItem; import com.smartgwt.client.widgets.form.fields.StaticTextItem; -import com.smartgwt.client.widgets.layout.VLayout;
import org.rhq.core.domain.criteria.ResourceOperationHistoryCriteria; import org.rhq.core.domain.operation.OperationDefinition; @@ -39,11 +38,12 @@ import org.rhq.enterprise.gui.coregui.client.ViewId; import org.rhq.enterprise.gui.coregui.client.ViewPath; import org.rhq.enterprise.gui.coregui.client.components.configuration.ConfigurationEditor; import org.rhq.enterprise.gui.coregui.client.gwt.GWTServiceLookup; +import org.rhq.enterprise.gui.coregui.client.util.selenium.LocatableVLayout;
/** * @author Greg Hinkle */ -public class OperationDetailsView extends VLayout implements BookmarkableView { +public class OperationDetailsView extends LocatableVLayout implements BookmarkableView {
private int historyId; private OperationDefinition definition; @@ -52,10 +52,14 @@ public class OperationDetailsView extends VLayout implements BookmarkableView { private ViewId viewId;
private DynamicForm form; + public OperationDetailsView() { }
- public OperationDetailsView(OperationDefinition definition, ResourceOperationHistory operationHistory) { + public OperationDetailsView(String locatorId, OperationDefinition definition, + ResourceOperationHistory operationHistory) { + super(locatorId); + this.definition = definition; this.operationHistory = operationHistory; } @@ -68,13 +72,11 @@ public class OperationDetailsView extends VLayout implements BookmarkableView { child.destroy(); }
- if (this.operationHistory != null) { displayDetails(operationHistory); } }
- private void displayDetails(ResourceOperationHistory operationHistory) {
for (Canvas child : getMembers()) { @@ -98,14 +100,12 @@ public class OperationDetailsView extends VLayout implements BookmarkableView { StaticTextItem operationItem = new StaticTextItem("operation", "Operation"); operationItem.setValue(definition.getName());
- StaticTextItem submittedItem = new StaticTextItem("submitted", "Date Submitted"); submittedItem.setValue(new Date(operationHistory.getStartedTime()));
StaticTextItem completedItem = new StaticTextItem("completed", "Date Completed"); completedItem.setValue(new Date(operationHistory.getStartedTime() + operationHistory.getDuration()));
- StaticTextItem requesterItem = new StaticTextItem("requester", "Requester"); requesterItem.setValue(operationHistory.getSubjectName());
@@ -120,7 +120,7 @@ public class OperationDetailsView extends VLayout implements BookmarkableView { Status: Success */
- form.setItems(operationItem, submittedItem, completedItem, requesterItem,statusItem); + form.setItems(operationItem, submittedItem, completedItem, requesterItem, statusItem);
addMember(form);
@@ -130,7 +130,7 @@ public class OperationDetailsView extends VLayout implements BookmarkableView {
DynamicForm errorDisplay = new DynamicForm(); errorDisplay.setNumCols(1); - AutoFitTextAreaItem errorText = new AutoFitTextAreaItem("error","Error"); + AutoFitTextAreaItem errorText = new AutoFitTextAreaItem("error", "Error"); errorText.setTitleOrientation(TitleOrientation.TOP); errorText.setValue(operationHistory.getErrorMessage());
@@ -138,15 +138,14 @@ public class OperationDetailsView extends VLayout implements BookmarkableView {
if (operationHistory.getResults() != null) {
- ConfigurationEditor resultsEditor = new ConfigurationEditor(definition.getResultsConfigurationDefinition(), operationHistory.getResults()); + ConfigurationEditor resultsEditor = new ConfigurationEditor(this.getLocatorId(), definition + .getResultsConfigurationDefinition(), operationHistory.getResults()); resultsEditor.setReadOnly(true); addMember(resultsEditor); }
}
- - private void lookupDetails(int historyId) { ResourceOperationHistoryCriteria criteria = new ResourceOperationHistoryCriteria();
@@ -156,26 +155,23 @@ public class OperationDetailsView extends VLayout implements BookmarkableView { criteria.fetchParameters(true); criteria.fetchResults(true);
- GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria( - criteria, new AsyncCallback<PageList<ResourceOperationHistory>>() { - public void onFailure(Throwable caught) { - CoreGUI.getErrorHandler().handleError("Failure loading operation history", caught); - } + GWTServiceLookup.getOperationService().findResourceOperationHistoriesByCriteria(criteria, + new AsyncCallback<PageList<ResourceOperationHistory>>() { + public void onFailure(Throwable caught) { + CoreGUI.getErrorHandler().handleError("Failure loading operation history", caught); + }
- public void onSuccess(PageList<ResourceOperationHistory> result) { - ResourceOperationHistory item = result.get(0); - displayDetails(item); - } + public void onSuccess(PageList<ResourceOperationHistory> result) { + ResourceOperationHistory item = result.get(0); + displayDetails(item); } - ); + }); }
+ public static void displayDetailsDialog(String locatorId, ResourceOperationHistory operationHistory) {
- - public static void displayDetailsDialog(ResourceOperationHistory operationHistory) { - - OperationDetailsView detailsView = new OperationDetailsView(operationHistory.getOperationDefinition(), operationHistory); - + OperationDetailsView detailsView = new OperationDetailsView(locatorId, operationHistory + .getOperationDefinition(), operationHistory);
Window window = new Window(); window.setTitle(operationHistory.getOperationDefinition().getDisplayName() + " History"); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java index 3ff18c6..84c6b55 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/factory/ConfigurationStep.java @@ -43,7 +43,7 @@ public class ConfigurationStep extends AbstractWizardStep { ConfigurationDefinition def = wizard.getConfigurationDefinition(); Configuration startingConfig = wizard.getConfiguration();
- editor = new ConfigurationEditor(def, startingConfig); + editor = new ConfigurationEditor("ResourceFactoryConfig", def, startingConfig); } return editor; } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHeaderControl.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHeaderControl.java new file mode 100644 index 0000000..a43e2ad --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableHeaderControl.java @@ -0,0 +1,53 @@ +package org.rhq.enterprise.gui.coregui.client.util.selenium; + +import com.smartgwt.client.widgets.HeaderControl; +import com.smartgwt.client.widgets.events.ClickHandler; + +/** + * Wrapper for com.smartgwt.client.widgets.layout.VLayout that sets the ID for use with selenium scLocators. + * + * @author Jay Shaughnessy + */ +public class LocatableHeaderControl extends HeaderControl implements Locatable { + + private String locatorId; + + /** + * <pre> + * ID Format: "scClassname-locatorId" + * </pre> + * @param locatorId not null or empty. + * @param icon + */ + public LocatableHeaderControl(String locatorId, HeaderIcon icon) { + super(icon); + init(locatorId); + } + + /** + * <pre> + * ID Format: "scClassname-locatorId" + * </pre> + * @param locatorId not null or empty. + * @param icon + * @param handler + */ + public LocatableHeaderControl(String locatorId, HeaderIcon icon, ClickHandler handler) { + super(icon, handler); + init(locatorId); + } + + private void init(String locatorId) { + this.locatorId = locatorId; + SeleniumUtility.setID(this, locatorId); + } + + public String getLocatorId() { + return locatorId; + } + + public String extendLocatorId(String extension) { + return this.locatorId + "-" + extension; + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableMenu.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableMenu.java new file mode 100644 index 0000000..72c27c6 --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableMenu.java @@ -0,0 +1,38 @@ +package org.rhq.enterprise.gui.coregui.client.util.selenium; + +import com.smartgwt.client.widgets.menu.Menu; + +/** + * Wrapper for com.smartgwt.client.widgets.menu.Menu that sets the ID for use with selenium scLocators. + * + * @author Jay Shaughnessy + */ +public class LocatableMenu extends Menu implements Locatable { + + private String locatorId; + + /** + * <pre> + * ID Format: "scClassname-locatorId" + * </pre> + * @param locatorId not null or empty. + */ + public LocatableMenu(String locatorId) { + super(); + init(locatorId); + } + + private void init(String locatorId) { + this.locatorId = locatorId; + SeleniumUtility.setID(this, locatorId); + } + + public String getLocatorId() { + return locatorId; + } + + public String extendLocatorId(String extension) { + return this.locatorId + "-" + extension; + } + +} diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableWindow.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableWindow.java new file mode 100644 index 0000000..17378ec --- /dev/null +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/selenium/LocatableWindow.java @@ -0,0 +1,38 @@ +package org.rhq.enterprise.gui.coregui.client.util.selenium; + +import com.smartgwt.client.widgets.Window; + +/** + * Wrapper for com.smartgwt.client.widgets.Window that sets the ID for use with selenium scLocators. + * + * @author Jay Shaughnessy + */ +public class LocatableWindow extends Window implements Locatable { + + private String locatorId; + + /** + * <pre> + * ID Format: "scClassname-locatorId" + * </pre> + * @param locatorId not null or empty. + */ + public LocatableWindow(String locatorId) { + super(); + init(locatorId); + } + + private void init(String locatorId) { + this.locatorId = locatorId; + SeleniumUtility.setID(this, locatorId); + } + + public String getLocatorId() { + return locatorId; + } + + public String extendLocatorId(String extension) { + return this.locatorId + "-" + extension; + } + +}
commit 221f01efd056f5f58e894c07caf22b937825e185 Author: Jay Shaughnessy jshaughn@redhat.com Date: Mon Aug 30 10:00:32 2010 -0400
Selenium Work - change many occurences of getLocatorId() to extendLocatorId(extension) when specifying child widget locatorIds. In most cases using the parent's ID for the child is not a specific enough ID. Use extendLocatorId unless you're positive you won't have an ID clash with the parent or a sibling.
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java index a30ec00..ad9c982 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/admin/roles/RoleEditView.java @@ -102,7 +102,7 @@ public class RoleEditView extends LocatableVLayout {
editCanvas.addMember(editLabel);
- form = new LocatableDynamicForm(getLocatorId()); + form = new LocatableDynamicForm(extendLocatorId("RoleForm")); form.setWidth100();
form.setDataSource(RolesDataSource.getInstance()); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java index 0e6d7ec..32fd4fc 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/deployment/BundleDeploymentView.java @@ -93,8 +93,9 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab this.version = bundleDeployment.getBundleVersion(); this.bundle = bundleDeployment.getBundleVersion().getBundle();
- addMember(new BackButton(getLocatorId(), "Back to Destination: " + deployment.getDestination().getName(), - "Bundles/Bundle/" + version.getBundle().getId() + "/destinations/" + deployment.getDestination().getId())); + addMember(new BackButton(extendLocatorId("BackButton"), "Back to Destination: " + + deployment.getDestination().getName(), "Bundles/Bundle/" + version.getBundle().getId() + "/destinations/" + + deployment.getDestination().getId()));
addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleDeployment_24.png"), deployment.getName()));
@@ -159,7 +160,7 @@ public class BundleDeploymentView extends LocatableVLayout implements Bookmarkab }
private Table createDeploymentsTable() { - Table table = new Table(getLocatorId(), "Deployment Machines"); + Table table = new Table(extendLocatorId("Deployments"), "Deployment Machines");
table.setTitleComponent(new HTMLFlow("Select a row to show install details."));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java index 2228dc5..8297e49 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/destination/BundleDestinationView.java @@ -83,8 +83,8 @@ public class BundleDestinationView extends LocatableVLayout implements Bookmarka this.destination = bundleDestination; this.bundle = bundleDestination.getBundle();
- addMember(new BackButton(getLocatorId(), "Back to Bundle: " + bundle.getName(), "Bundles/Bundle/" - + bundle.getId())); + addMember(new BackButton(extendLocatorId("BackButton"), "Back to Bundle: " + bundle.getName(), + "Bundles/Bundle/" + bundle.getId()));
addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleDestination_24.png"), destination.getName()));
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java index 0206f68..9fde57b 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/list/BundleView.java @@ -95,7 +95,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView {
this.bundle = bundle;
- addMember(new BackButton(getLocatorId(), "Back to All Bundles", "Bundles")); + addMember(new BackButton(extendLocatorId("BackButton"), "Back to All Bundles", "Bundles"));
headerLabel = new HeaderLabel("subsystems/bundle/Bundle_24.png", bundle.getName());
@@ -150,7 +150,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView {
private DynamicForm createSummaryForm() {
- form = new LocatableDynamicForm(getLocatorId()); + form = new LocatableDynamicForm(extendLocatorId("Summary")); form.setWidth100(); form.setColWidths("20%", "30%", "25%", "25%"); form.setNumCols(4); @@ -174,7 +174,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView {
private CanvasItem getTagItem() {
- TagEditorView tagEditor = new TagEditorView(form.getLocatorId(), bundle.getTags(), false, + TagEditorView tagEditor = new TagEditorView(form.extendLocatorId("TagEditor"), bundle.getTags(), false, new TagsChangedCallback() { public void tagsChanged(HashSet<Tag> tags) { GWTServiceLookup.getTagService().updateBundleTags(bundleBeingViewed, tags, @@ -201,7 +201,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { }
private CanvasItem getActionItem() { - VLayout layout = new LocatableVLayout(form.getLocatorId(), 10); + VLayout layout = new LocatableVLayout(form.extendLocatorId("Actions"), 10);
IButton deleteButton = new LocatableIButton(form.extendLocatorId("Delete"), "Delete"); deleteButton.setIcon("subsystems/bundle/BundleAction_Delete_16.png"); @@ -312,7 +312,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { } else { // one version removeMembers(getMembers()); - BundleVersionView view = new BundleVersionView(getLocatorId()); + BundleVersionView view = new BundleVersionView(extendLocatorId("Version")); addMember(view); view.renderView(viewPath.next()); } @@ -323,7 +323,7 @@ public class BundleView extends LocatableVLayout implements BookmarkableView { } else { // one version removeMembers(getMembers()); - BundleDeploymentView view = new BundleDeploymentView(getLocatorId()); + BundleDeploymentView view = new BundleDeploymentView(extendLocatorId("Deployment")); addMember(view); view.renderView(viewPath.next()); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java index 984a22d..6f9d187 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/BundleVersionView.java @@ -81,8 +81,8 @@ public class BundleVersionView extends LocatableVLayout implements BookmarkableV
// tabs.addTab(createUpdateHistoryTab());
- addMember(new BackButton(getLocatorId(), "Back to Bundle: " + version.getBundle().getName(), "Bundles/Bundle/" - + version.getBundle().getId())); + addMember(new BackButton(extendLocatorId("BackButton"), "Back to Bundle: " + version.getBundle().getName(), + "Bundles/Bundle/" + version.getBundle().getId()));
addMember(new HeaderLabel(Canvas.getImgURL("subsystems/bundle/BundleVersion_24.png"), version.getName() + ": " + version.getVersion())); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java index e91bfa0..3390716 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/bundle/version/file/FileListView.java @@ -53,7 +53,7 @@ public class FileListView extends LocatableVLayout {
private void viewFiles(PageList<BundleFile> files) {
- Table table = new Table(getLocatorId(), "Bundle Files"); + Table table = new Table(extendLocatorId("BundleFiles"), "Bundle Files");
ListGrid listGrid = table.getListGrid();
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java index b167872..f9e9479 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/table/Table.java @@ -293,7 +293,7 @@ public class Table extends LocatableHLayout {
footer.addMember(new LayoutSpacer());
- IButton refreshButton = new LocatableIButton("Refresh", "Refresh"); + IButton refreshButton = new LocatableIButton(extendLocatorId("Refresh"), "Refresh"); refreshButton.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { listGrid.invalidateCache(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java index 18bb864..01235c4 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/components/tagging/TagEditorView.java @@ -138,8 +138,8 @@ public class TagEditorView extends LocatableLayout { spacer.setHeight(16); spacer.setWidth(16);
- final Img remove = new LocatableImg(tagLayout.getLocatorId(), "[skin]/images/actions/remove.png", 16, - 16); + final Img remove = new LocatableImg(tagLayout.extendLocatorId("Remove"), + "[skin]/images/actions/remove.png", 16, 16); remove.setTooltip("Click to remove this tag"); remove.addClickHandler(new ClickHandler() { public void onClick(ClickEvent clickEvent) { diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java index 27cfc12..9882051 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTitleBar.java @@ -87,7 +87,7 @@ public class ResourceGroupTitleBar extends LocatableHLayout {
badge = new Img("types/Service_up_24.png", 24, 24);
- TagEditorView tagEditorView = new TagEditorView(getLocatorId(), group.getTags(), false, + TagEditorView tagEditorView = new TagEditorView(extendLocatorId("Editor"), group.getTags(), false, new TagsChangedCallback() { public void tagsChanged(final HashSet<Tag> tags) { GWTServiceLookup.getTagService().updateResourceGroupTags(group.getId(), tags, diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java index f313480..7865edd 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/groups/detail/ResourceGroupTopView.java @@ -69,7 +69,7 @@ public class ResourceGroupTopView extends LocatableHLayout implements Bookmarkab contentCanvas = new Canvas(); addMember(contentCanvas);
- detailView = new ResourceGroupDetailView(getLocatorId()); + detailView = new ResourceGroupDetailView(extendLocatorId("Detail"));
// treeView.addResourceSelectListener(detailView);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java index f6554ff..67feee5 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceDetailView.java @@ -69,6 +69,7 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable private static final String DEFAULT_TAB_NAME = "Summary";
private int resourceId; + private ResourceComposite resourceComposite;
private TwoLevelTabSet topTabSet; @@ -124,7 +125,7 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable
// The Tabs section
- topTabSet = new TwoLevelTabSet(getLocatorId()); + topTabSet = new TwoLevelTabSet(extendLocatorId("TabSet")); topTabSet.setTabBarPosition(Side.TOP); topTabSet.setWidth100(); topTabSet.setHeight100(); @@ -189,12 +190,12 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable
topTabSet.addTwoLevelTabSelectedHandler(this);
- titleBar = new ResourceTitleBar(getLocatorId()); - addMember(titleBar); + titleBar = new ResourceTitleBar(extendLocatorId("TitleBar"));
+ addMember(titleBar); addMember(topTabSet);
- // CoreGUI.addBreadCrumb(getPlace()); + // CoreGUI.addBreadCrumb(getPlace()); }
public void updateDetailViews(ResourceComposite resourceComposite) { @@ -261,7 +262,7 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable
this.alertHistory.setCanvas(new FullHTMLPane("/rhq/resource/alert/listAlertHistory-plain.xhtml?id=" + resource.getId())); - this.alertDef.setCanvas(new ResourceAlertDefinitionsView(alertsTab.getLocatorId(), resource)); + this.alertDef.setCanvas(new ResourceAlertDefinitionsView(alertsTab.extendLocatorId("Def"), resource)); this.alertDelete.setCanvas(new FullHTMLPane("/rhq/resource/alert/listAlertDefinitions-plain.xhtml?id=" + resource.getId())); alertsTab.updateSubTab(this.alertHistory); @@ -269,8 +270,8 @@ public class ResourceDetailView extends LocatableVLayout implements Bookmarkable alertsTab.updateSubTab(this.alertDelete);
this.configCurrent.setCanvas(new ResourceConfigurationEditView(resource)); - this.configHistory.setCanvas(ConfigurationHistoryView.getHistoryOf(configurationTab.getLocatorId(), resource - .getId())); + this.configHistory.setCanvas(ConfigurationHistoryView.getHistoryOf(configurationTab.extendLocatorId("Hist"), + resource.getId())); configurationTab.updateSubTab(this.configCurrent); configurationTab.updateSubTab(this.configHistory);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java index 7882473..ae049ce 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/ResourceTopView.java @@ -35,7 +35,7 @@ public class ResourceTopView extends LocatableHLayout implements BookmarkableVie private Canvas contentCanvas;
private ResourceTreeView treeView; - private ResourceDetailView detailView = new ResourceDetailView(getLocatorId()); + private ResourceDetailView detailView = new ResourceDetailView(extendLocatorId("Detail"));
private ResourceGWTServiceAsync resourceService = GWTServiceLookup.getResourceService();
@@ -50,7 +50,7 @@ public class ResourceTopView extends LocatableHLayout implements BookmarkableVie setWidth100(); setHeight100();
- treeView = new ResourceTreeView(getLocatorId()); + treeView = new ResourceTreeView(extendLocatorId("Tree")); addMember(treeView);
contentCanvas = new Canvas(); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java index 472ee86..8351278 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/configuration/ConfigurationHistoryView.java @@ -72,7 +72,7 @@ public class ConfigurationHistoryView extends LocatableVLayout {
final ConfigurationHistoryDataSource datasource = new ConfigurationHistoryDataSource();
- Table table = new Table(getLocatorId(), "Configuration History", criteria); + Table table = new Table(extendLocatorId("Table"), "Configuration History", criteria); table.setDataSource(datasource); table.getListGrid().setUseAllDataSourceFields(true);
diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/calltime/CallTimeView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/calltime/CallTimeView.java index 779e3f8..557343c 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/calltime/CallTimeView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/inventory/resource/detail/monitoring/calltime/CallTimeView.java @@ -112,8 +112,8 @@ public class CallTimeView extends LocatableLayout {
public void setup() {
- Table table = new Table(getLocatorId(), "Call Time Data", - new Criteria("scheduleId", String.valueOf(scheduleId))); + Table table = new Table(extendLocatorId("Table"), "Call Time Data", new Criteria("scheduleId", String + .valueOf(scheduleId))); table.getListGrid().setAlternateRecordStyles(false); table.setDataSource(new CallTimeDataSource()); table.getListGrid().setUseAllDataSourceFields(true); diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java index c3ac4d6..981852e 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/report/tag/TaggedView.java @@ -62,7 +62,7 @@ public class TaggedView extends LocatableVLayout implements BookmarkableView { protected void onInit() { super.onInit();
- tagCloudView = new TagCloudView(getLocatorId()); + tagCloudView = new TagCloudView(extendLocatorId("TagCloud")); tagCloudView.setAutoHeight(); addMember(tagCloudView); } diff --git a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java index 0ede8cd..39364d8 100644 --- a/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java +++ b/modules/enterprise/gui/coregui/src/main/java/org/rhq/enterprise/gui/coregui/client/util/message/MessageCenterView.java @@ -68,7 +68,8 @@ public class MessageCenterView extends LocatableHLayout implements MessageCenter
final Menu recentEventsMenu = new Menu();
- IMenuButton recentEventsButton = new LocatableIMenuButton(getLocatorId(), "Messages", recentEventsMenu); + IMenuButton recentEventsButton = new LocatableIMenuButton(extendLocatorId("RecentEvents"), "Messages", + recentEventsMenu); recentEventsButton.setTop(5); recentEventsButton.setShowMenuBelow(false); recentEventsButton.setAutoFit(true); @@ -98,7 +99,7 @@ public class MessageCenterView extends LocatableHLayout implements MessageCenter } });
- VLayout vl = new LocatableVLayout(getLocatorId()); + VLayout vl = new LocatableVLayout(extendLocatorId("Alignment")); vl.setAutoWidth(); vl.setAlign(Alignment.LEFT); vl.setAlign(VerticalAlignment.CENTER); @@ -109,7 +110,7 @@ public class MessageCenterView extends LocatableHLayout implements MessageCenter }
private void showDetails(Message message) { - DynamicForm form = new LocatableDynamicForm(getLocatorId()); + DynamicForm form = new LocatableDynamicForm(extendLocatorId("Details")); form.setWrapItemTitles(false);
StaticTextItem title = new StaticTextItem("title", "Title");
rhq-commits@lists.fedorahosted.org