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

HAL-225 - Core queues are not visible in destinations listing #220

Merged
merged 1 commit into from
May 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
441 changes: 221 additions & 220 deletions gui/src/main/java/org/jboss/as/console/client/shared/CoreBeanFactory.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
package org.jboss.as.console.client.shared.subsys.activemq;

import java.util.List;

import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqConnectionFactory;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqCoreQueue;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqJMSEndpoint;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqQueue;

import java.util.List;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqJMSQueue;

/**
* @author Heiko Braun
Expand All @@ -13,27 +14,34 @@
public class AggregatedJMSModel {

private List<ActivemqConnectionFactory> factories;
private List<ActivemqQueue> queues;
private List<ActivemqJMSQueue> jmsQueues;
private List<ActivemqCoreQueue> coreQueues;
private List<ActivemqJMSEndpoint> topics;

public AggregatedJMSModel(
List<ActivemqConnectionFactory> factories,
List<ActivemqQueue> queues,
List<ActivemqJMSEndpoint> topics) {
List<ActivemqJMSQueue> jmsQueues,
List<ActivemqJMSEndpoint> topics,
List<ActivemqCoreQueue> queues) {
this.factories = factories;
this.queues = queues;
this.jmsQueues = jmsQueues;
this.topics = topics;
this.coreQueues = queues;
}

public List<ActivemqConnectionFactory> getFactories() {
return factories;
}

public List<ActivemqQueue> getQueues() {
return queues;
public List<ActivemqJMSQueue> getJMSQueues() {
return jmsQueues;
}

public List<ActivemqJMSEndpoint> getTopics() {
return topics;
}

public List<ActivemqCoreQueue> getQueues() {
return coreQueues;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/

package org.jboss.as.console.client.shared.subsys.activemq;

import java.util.List;

import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.google.gwt.user.client.ui.ScrollPanel;
import com.google.gwt.user.client.ui.TabPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqCoreQueue;
import org.jboss.as.console.client.widgets.ContentDescription;

/**
* @author Claudio Miranda
*/
public class CoreQueueEditor {

private MsgDestinationsPresenter presenter;
private CoreQueueList queueList;

private HTML serverName;

public CoreQueueEditor(MsgDestinationsPresenter presenter) {
this.presenter = presenter;
}

public Widget asWidget() {
LayoutPanel layout = new LayoutPanel();

VerticalPanel panel = new VerticalPanel();
panel.setStyleName("rhs-content-panel");

ScrollPanel scroll = new ScrollPanel(panel);
layout.add(scroll);
layout.setWidgetTopHeight(scroll, 0, Style.Unit.PX, 100, Style.Unit.PCT);

serverName = new HTML("Replace me");
serverName.setStyleName("content-header-label");

panel.add(serverName);
panel.add(new ContentDescription("Core Queue."));

TabPanel bottomLayout = new TabPanel();
bottomLayout.addStyleName("default-tabpanel");
bottomLayout.addStyleName("master_detail-detail");

queueList = new CoreQueueList(presenter);
bottomLayout.add(queueList.asWidget(), "Queues");

bottomLayout.selectTab(0);

panel.add(bottomLayout);

return layout;
}

public void setQueues(List<ActivemqCoreQueue> queues) {
queueList.setQueues(queues);
serverName.setText("Core queue: Provider " + presenter.getCurrentServer());
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
/*
* JBoss, Home of Professional Open Source
* Copyright 2011 Red Hat Inc. and/or its affiliates and other contributors
* as indicated by the @author tags. All rights reserved.
* See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This copyrighted material is made available to anyone wishing to use,
* modify, copy, or redistribute it subject to the terms and conditions
* of the GNU Lesser General Public License, v. 2.1.
* This program is distributed in the hope that it will be useful, but WITHOUT A
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
* You should have received a copy of the GNU Lesser General Public License,
* v.2.1 along with this distribution; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
* MA 02110-1301, USA.
*/

package org.jboss.as.console.client.shared.subsys.activemq;

import java.util.List;

import com.google.gwt.user.cellview.client.TextColumn;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.google.gwt.view.client.ListDataProvider;
import org.jboss.as.console.client.Console;
import org.jboss.as.console.client.shared.help.FormHelpPanel;
import org.jboss.as.console.client.shared.subsys.Baseadress;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqCoreQueue;
import org.jboss.ballroom.client.widgets.ContentGroupLabel;
import org.jboss.ballroom.client.widgets.forms.CheckBoxItem;
import org.jboss.ballroom.client.widgets.forms.Form;
import org.jboss.ballroom.client.widgets.forms.TextItem;
import org.jboss.ballroom.client.widgets.tables.DefaultCellTable;
import org.jboss.ballroom.client.widgets.tables.DefaultPager;
import org.jboss.ballroom.client.widgets.tools.ToolButton;
import org.jboss.ballroom.client.widgets.tools.ToolStrip;
import org.jboss.ballroom.client.widgets.window.Feedback;
import org.jboss.dmr.client.ModelNode;

/**
* @author Claudio Miranda
*/
public class CoreQueueList {

private DefaultCellTable<ActivemqCoreQueue> queueTable;
private ListDataProvider<ActivemqCoreQueue> queueProvider;

private MsgDestinationsPresenter presenter;

public CoreQueueList(MsgDestinationsPresenter presenter) {
this.presenter = presenter;
}

@SuppressWarnings("unchecked")
Widget asWidget() {

VerticalPanel layout = new VerticalPanel();

Form<ActivemqCoreQueue> form = new Form<>(ActivemqCoreQueue.class);

ToolStrip tableTools = new ToolStrip();
ToolButton addBtn = new ToolButton(Console.CONSTANTS.common_label_add(),
event -> presenter.launchNewCoreQueueDialogue());
addBtn.ensureDebugId(Console.DEBUG_CONSTANTS.debug_label_add_queueList());
tableTools.addToolButtonRight(addBtn);

ToolButton removeBtn = new ToolButton(Console.CONSTANTS.common_label_delete(), event -> Feedback.confirm(
Console.MESSAGES.deleteTitle("Queue"),
Console.MESSAGES.deleteConfirm("queue: " + form.getEditedEntity().getName()),
isConfirmed -> {
if (isConfirmed) { presenter.onDeleteCoreQueue(form.getEditedEntity()); }
}));

tableTools.addToolButtonRight(removeBtn);

layout.add(tableTools.asWidget());

queueTable = new DefaultCellTable<>(8, ActivemqCoreQueue::getQueueAddress);
queueProvider = new ListDataProvider<>();
queueProvider.addDataDisplay(queueTable);

TextColumn<ActivemqCoreQueue> nameColumn = new TextColumn<ActivemqCoreQueue>() {
@Override
public String getValue(ActivemqCoreQueue record) {
return record.getName();
}
};
TextColumn<ActivemqCoreQueue> addressColumn = new TextColumn<ActivemqCoreQueue>() {
@Override
public String getValue(ActivemqCoreQueue record) {
return record.getQueueAddress();
}
};

queueTable.addColumn(nameColumn, "Name");
queueTable.addColumn(addressColumn, "Address");

layout.add(queueTable);

DefaultPager pager = new DefaultPager();
pager.setDisplay(queueTable);
layout.add(pager);

pager.getElement().setAttribute("style", "margin-bottom:15px;");

TextItem name = new TextItem("name", "Name");
TextItem queueAddress = new TextItem("queueAddress", "Address");
TextItem filter = new TextItem("filter", "Filter");
CheckBoxItem durable = new CheckBoxItem("durable", "Durable");

// Queues are read-only after creation
form.setFields(name, queueAddress, filter, durable);
form.bind(queueTable);
form.setEnabled(false);

final FormHelpPanel helpPanel = new FormHelpPanel(() -> {
ModelNode address = Baseadress.get();
address.add("subsystem", "messaging-activemq");
address.add("server", presenter.getCurrentServer());
address.add("queue", "*");
return address;
}, form);

layout.add(new ContentGroupLabel("Queues are read-only after creation"));
layout.add(helpPanel.asWidget());
layout.add(form.asWidget());

return layout;
}

void setQueues(List<ActivemqCoreQueue> queues) {
queueProvider.setList(queues);
queueTable.selectDefaultEntity();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@

package org.jboss.as.console.client.shared.subsys.activemq;

import java.util.List;

import com.google.gwt.dom.client.Style;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.LayoutPanel;
Expand All @@ -27,20 +29,18 @@
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqJMSEndpoint;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqQueue;
import org.jboss.as.console.client.shared.subsys.activemq.model.ActivemqJMSQueue;
import org.jboss.as.console.client.widgets.ContentDescription;

import java.util.List;

/**
* @author Heiko Braun
* @date 3/29/11
*/
public class JMSEditor {

private MsgDestinationsPresenter presenter;
private TopicList topicList;
private QueueList queueList;
private JMSTopicList topicList;
private JMSQueueList queueList;

private HTML serverName;

Expand All @@ -62,16 +62,16 @@ public Widget asWidget() {
serverName.setStyleName("content-header-label");

panel.add(serverName);
panel.add(new ContentDescription("Queue and Topic destinations."));
panel.add(new ContentDescription("JMS Queue and Topic destinations."));

TabPanel bottomLayout = new TabPanel();
bottomLayout.addStyleName("default-tabpanel");
bottomLayout.addStyleName("master_detail-detail");

queueList = new QueueList(presenter);
queueList = new JMSQueueList(presenter);
bottomLayout.add(queueList.asWidget(), "Queues");

topicList = new TopicList(presenter);
topicList = new JMSTopicList(presenter);
bottomLayout.add(topicList.asWidget(), "Topics");

bottomLayout.selectTab(0);
Expand All @@ -86,7 +86,7 @@ public void setTopics(List<ActivemqJMSEndpoint> topics) {
topicList.setTopics(topics);
}

public void setQueues(List<ActivemqQueue> queues) {
public void setQueues(List<ActivemqJMSQueue> queues) {
queueList.setQueues(queues);
serverName.setText("JMS Endpoints: Provider " + presenter.getCurrentServer());
}
Expand Down