You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by to...@apache.org on 2010/08/07 18:58:01 UTC
svn commit: r983258 [3/4] - in /cxf/sandbox/logbrowser:
distribution/src/main/release/samples/logbrowser/src/demo/logbrowser/
rt/management-web/
rt/management-web/src/main/java/org/apache/cxf/management/web/logging/bootstrapping/
rt/management-web/src/...
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlView.ui.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlView.ui.xml?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlView.ui.xml (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlView.ui.xml Sat Aug 7 16:57:58 2010
@@ -0,0 +1,65 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+
+ <ui:with field='res'
+ type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/>
+
+ <g:HTMLPanel>
+ <form action="#" class="{res.css.accessControlTab}">
+ <fieldset>
+ <legend>Authentication</legend>
+
+ <p>
+ <label for="copies">Username:</label>
+ <g:TextBox ui:field='usernameTextBox'></g:TextBox>
+ </p>
+
+ <p>
+ <label for="copies">Password:</label>
+ <g:PasswordTextBox ui:field='passwordTextBox'></g:PasswordTextBox>
+ </p>
+
+ <p>
+ <g:Label ui:field="accessDeniedLabel"
+ visible="false"
+ addStyleNames="{res.css.accessControlTabErrorMessage}">
+ The username or password you entered is incorrect.
+ </g:Label>
+ </p>
+
+ <p>
+ <g:CheckBox ui:field='rememberMeCheckBox'
+ addStyleNames="{res.css.accessControlTabRememberMeCheckbox}">
+ Remember me
+ </g:CheckBox>
+ </p>
+
+ <p class="{res.css.accessControlTabSignInButton}">
+ <g:Button ui:field='signInButton'>
+ Sign in
+ </g:Button>
+ </p>
+ </fieldset>
+ </form>
+ </g:HTMLPanel>
+</ui:UiBinder>
\ No newline at end of file
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlViewImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlViewImpl.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlViewImpl.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/accesscontroler/AccessControlViewImpl.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,98 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.accesscontroler;
+
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.uibinder.client.UiTemplate;
+import com.google.gwt.user.client.ui.CheckBox;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasValue;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.PasswordTextBox;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class AccessControlViewImpl extends Composite implements AccessControlView {
+
+ @UiTemplate("AccessControlView.ui.xml")
+ interface AccessControlViewUiBinder extends UiBinder<Widget, AccessControlViewImpl> { }
+
+ private static final AccessControlViewUiBinder UI_BINDER = GWT.create(AccessControlViewUiBinder.class);
+
+ @UiField @Nonnull
+ TextBox usernameTextBox;
+
+ @UiField @Nonnull
+ CheckBox rememberMeCheckBox;
+
+ @UiField @Nonnull
+ PasswordTextBox passwordTextBox;
+
+ @UiField @Nonnull
+ Label accessDeniedLabel;
+
+ @Nullable
+ private Presenter presenter;
+
+ public AccessControlViewImpl() {
+ initWidget(UI_BINDER.createAndBindUi(this));
+ }
+
+ @UiHandler("signInButton")
+ void onAddButtonClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onSignInButtonClicked();
+ }
+
+ @Nonnull
+ public HasValue<String> getPassword() {
+ return passwordTextBox;
+ }
+
+ @Nonnull
+ public HasValue<Boolean> getRememberMe() {
+ return rememberMeCheckBox;
+ }
+
+ @Nonnull
+ public HasValue<String> getUsername() {
+ return usernameTextBox;
+ }
+
+ public void showAccessDeniedMessage() {
+ accessDeniedLabel.setVisible(true);
+ }
+
+ public void setPresenter(@Nonnull final Presenter presenter) {
+ this.presenter = presenter;
+ }
+
+ @Nonnull
+ public Widget asWidget() {
+ return this;
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowsePresenter.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,172 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import java.util.List;
+import javax.annotation.Nonnull;
+
+import com.google.gwt.http.client.Request;
+import com.google.gwt.user.client.ui.HasWidgets;
+import com.google.inject.Inject;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.EventBus;
+import org.apache.cxf.management.web.logging.logbrowser.client.event.GoToSettingsEvent;
+import org.apache.cxf.management.web.logging.logbrowser.client.event.SignOutEvent;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Feed;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.FeedProxyImpl;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Links;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.SettingsFacade;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.BasePresenter;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserConstans;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources;
+
+public class BrowsePresenter extends BasePresenter implements BrowseView.Presenter {
+ private final BrowseView view;
+ private final FeedProxyImpl proxy;
+ private final SettingsFacade settingsManager;
+
+ private Subscription selectedSubscription;
+ private Feed feed;
+
+ private List<Subscription> subscriptions;
+
+ @Nonnull
+ private final LogBrowserConstans constans;
+
+ @Nonnull
+ private final LogBrowserResources resources;
+
+ @Inject
+ public BrowsePresenter(@Nonnull final EventBus eventBus,
+ @Nonnull final BrowseView view,
+ @Nonnull final SettingsFacade settingsManager,
+ @Nonnull final FeedProxyImpl proxy,
+ @Nonnull final LogBrowserConstans constans,
+ @Nonnull final LogBrowserResources resources) {
+ super(eventBus);
+
+ this.view = view;
+ this.proxy = proxy;
+ this.settingsManager = settingsManager;
+ this.constans = constans;
+ this.resources = resources;
+
+ this.view.setPresenter(this);
+ this.view.setLinks(Links.EMPTY);
+
+ updateSubscriptions();
+ }
+
+ private void updateSubscriptions() {
+ subscriptions = settingsManager.getSubscriptions();
+ view.setSubscriptions(subscriptions);
+ }
+
+ public void go(@Nonnull final HasWidgets container) {
+ container.clear();
+ container.add(view.asWidget());
+ }
+
+ public void onManageSubscriptionsButtonClicked() {
+ eventBus.fireEvent(new GoToSettingsEvent());
+ }
+
+ public void onSubcriptionItemClicked(final int row) {
+ assert row >= 0 && row < subscriptions.size();
+ selectedSubscription = subscriptions.get(row);
+ getFeed(selectedSubscription.getUrl());
+ }
+
+ public void onEntryItemClicked(final int row) {
+ assert row >= 0 && row < feed.getEntries().size();
+ view.setEntryDetails(feed.getEntries().get(row));
+ }
+
+ public void onSignOutButtonClicked() {
+ eventBus.fireEvent(new SignOutEvent());
+ }
+
+ public void onNewerButtonClicked() {
+ getFeed(feed.getLinks().getNext());
+ }
+
+ public void onLastButtonClicked() {
+ getFeed(feed.getLinks().getLast());
+ }
+
+ public void onFirstButtonClicked() {
+ getFeed(feed.getLinks().getFirst());
+ }
+
+ public void onRefreshButtonClicked() {
+ getFeed(feed.getLinks().getSelf());
+ }
+
+ public void onOlderButtonClicked() {
+ getFeed(feed.getLinks().getPrevious());
+ }
+
+ private void setFeed(@Nonnull final Feed newFeed) {
+ feed = newFeed;
+
+ view.setEntryDetails(null);
+ view.setLinks(feed.getLinks());
+
+ if (feed.getEntries().isEmpty()) {
+ setNoEntriesMessage();
+ } else {
+ view.setEntries(feed.getEntries());
+ }
+ }
+
+ private void setNoEntriesMessage() {
+ view.setMessageInsteadOfEntries(constans.browserTabNoEntries(),
+ resources.css().browserTabNoEntriesMessage());
+ }
+
+ private void setLoadingMessage() {
+ view.setMessageInsteadOfEntries(constans.browserTabLoading(),
+ resources.css().browserTabLoadingMessage());
+ }
+
+ private void getFeed(@Nonnull final String url) {
+ setLoadingMessage();
+ proxy.getFeed(url, new FeedProxyImpl.Callback() {
+
+ @Override
+ public void onAccessDenied() {
+ setFeed(Feed.EMPTY);
+ }
+
+ @Override
+ public void onSuccess(@Nonnull final Feed newFeed) {
+ setFeed(newFeed);
+ }
+
+ @Override
+ public void onError(@Nonnull final Request request, @Nonnull final Throwable ex) {
+ setFeed(Feed.EMPTY);
+ super.onError(request, ex);
+ }
+
+ });
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,63 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import java.util.List;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Entry;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Links;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.View;
+
+public interface BrowseView extends View {
+
+ public interface Presenter {
+
+ void onSignOutButtonClicked();
+
+ void onManageSubscriptionsButtonClicked();
+
+ void onSubcriptionItemClicked(int row);
+
+ void onEntryItemClicked(int row);
+
+ void onOlderButtonClicked();
+
+ void onNewerButtonClicked();
+
+ void onLastButtonClicked();
+
+ void onFirstButtonClicked();
+
+ void onRefreshButtonClicked();
+ }
+
+ void setMessageInsteadOfEntries(String message, String styleName);
+
+ void setEntries(List<Entry> entries);
+
+ void setEntryDetails(Entry entry);
+
+ void setLinks(Links links);
+
+ void setSubscriptions(List<Subscription> subscriptions);
+
+ void setPresenter(Presenter presenter);
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.ui.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.ui.xml?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.ui.xml (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseView.ui.xml Sat Aug 7 16:57:58 2010
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui'
+ xmlns:logbrowser='urn:import:org.apache.cxf.management.web.logging.logbrowser.client.ui.browser'>
+
+ <ui:with field='res'
+ type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/>
+
+ <g:RootLayoutPanel>
+ <g:layer>
+ <g:DockLayoutPanel unit='EM'>
+ <g:north size='2'>
+ <g:Hyperlink ui:field="signOutHyperlink"
+ addStyleNames="{res.css.browserTabSignOutButton}">
+ Sign out
+ </g:Hyperlink>
+ </g:north>
+
+ <g:center>
+ <g:SplitLayoutPanel>
+ <g:west size='192'>
+ <g:DockLayoutPanel unit="EM"
+ styleName="{res.css.browserTabSubscriptionsSideBar}">
+ <g:north size="2.2">
+ <g:HTMLPanel>
+ <div class="{res.css.browserTabSubscriptionsHeader}">
+ Endpoints
+ </div>
+ </g:HTMLPanel>
+ </g:north>
+ <g:center>
+ <logbrowser:SubscriptionTable ui:field='subscriptionTable'
+ styleName='{res.css.browserTabEntrySelectableTable}'/>
+ </g:center>
+ <g:south size="2">
+ <g:Hyperlink ui:field="manageSubscriptionsHyperlink"
+ addStyleNames="{res.css.browserTabManageSubscriptionsButton}">
+ Manage endpoints »
+ </g:Hyperlink>
+ </g:south>
+ </g:DockLayoutPanel>
+ </g:west>
+
+ <g:north size='200'>
+ <g:DockLayoutPanel styleName='{res.css.browserTabToolBar}'
+ unit='EM'>
+ <g:north size='2.2'>
+ <g:FlexTable ui:field='entryTableHeader'
+ styleName='{res.css.browserTabEntryTableHeaders}'
+ cellSpacing='0'
+ cellPadding='0' />
+ </g:north>
+
+ <g:center>
+ <logbrowser:EntryTable ui:field='entryTable'
+ styleName='{res.css.browserTabEntrySelectableTable}'/>
+ </g:center>
+ </g:DockLayoutPanel>
+ </g:north>
+
+ <g:center>
+ <g:DockLayoutPanel styleName='{res.css.browserTabEntryDetailsSection}'
+ unit='EM'>
+ <g:center>
+ <g:ScrollPanel>
+ <g:HTML ui:field='entryDetails'
+ styleName='{res.css.browserTabEntryDetailsContent}'/>
+ </g:ScrollPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+ </g:center>
+ </g:SplitLayoutPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+ </g:layer>
+ </g:RootLayoutPanel>
+
+</ui:UiBinder>
\ No newline at end of file
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseViewImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseViewImpl.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseViewImpl.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/BrowseViewImpl.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,280 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.i18n.client.DateTimeFormat;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.uibinder.client.UiTemplate;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Entry;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Links;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserConstans;
+
+import static org.apache.cxf.management.web.logging.logbrowser.client.ui.browser
+ .SelectableTable.SelectRowHandler;
+import static org.apache.cxf.management.web.logging.logbrowser.client.ui.browser
+ .SubscriptionTable.ColumnDefinition;
+
+public class BrowseViewImpl extends Composite implements BrowseView {
+ private static final DateTimeFormat DT_FORMATTER =
+ DateTimeFormat.getFormat("HH:mm:ss.SSS dd.MM.yyyy");
+
+ @UiTemplate("BrowseView.ui.xml")
+ interface BrowseViewUiBinder extends UiBinder<Widget, BrowseViewImpl> { }
+
+ private static final BrowseViewUiBinder UI_BINDER = GWT.create(BrowseViewUiBinder.class);
+
+ @UiField @Nonnull
+ SubscriptionTable subscriptionTable;
+
+ @UiField @Nonnull
+ FlexTable entryTableHeader;
+
+ @UiField @Nonnull
+ EntryTable entryTable;
+
+ @UiField @Nonnull
+ HTML entryDetails;
+
+ @Nonnull
+ private NavigationLinks navigationLinks;
+
+ @Nullable
+ private Presenter presenter;
+
+ @Nonnull
+ private final LogBrowserConstans constans;
+
+ @Inject
+ public BrowseViewImpl(@Nonnull final LogBrowserConstans constans) {
+ this.constans = constans;
+
+ initWidget(UI_BINDER.createAndBindUi(this));
+
+ initNavigationLinks();
+ initEntryTableHeader();
+
+ initSubscriptionTable();
+ initEntryTable();
+ }
+
+ public void setSubscriptions(@Nonnull final List<Subscription> subscriptions) {
+ subscriptionTable.setData(subscriptions);
+ }
+
+ public void setEntries(@Nonnull final List<Entry> entries) {
+ entryTable.setData(entries);
+ }
+
+ public void setMessageInsteadOfEntries(@Nonnull final String message, @Nullable final String styleName) {
+ entryTable.setMessageInsteadOfData(message, styleName);
+ }
+
+ public void setEntryDetails(@Nullable final Entry entry) {
+ if (entry == null) {
+ entryDetails.setHTML("");
+ return;
+ }
+
+ StringBuilder sb = new StringBuilder();
+
+ if (entry.getMessage() != null) {
+ sb.append(entry.getMessage()).append("\n");
+ }
+ if (entry.getThrowable() != null) {
+ sb.append(entry.getThrowable());
+ }
+
+ entryDetails.setHTML(sb.toString());
+ }
+
+ public void setLinks(@Nonnull final Links links) {
+ navigationLinks.olderButton.setVisible(links.previousAvailable());
+ navigationLinks.newerButton.setVisible(links.nextAvailable());
+ navigationLinks.refreshButton.setVisible(links.selfAvailable());
+ navigationLinks.lastButton.setVisible(links.lastAvailable());
+ navigationLinks.firstButton.setVisible(links.firstAvailable());
+ }
+
+ @UiHandler("signOutHyperlink")
+ void onSignOutHyperlinkClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onSignOutButtonClicked();
+ }
+
+ @UiHandler("manageSubscriptionsHyperlink")
+ void onManageSubscriptionsHyperlinkClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onManageSubscriptionsButtonClicked();
+ }
+
+ public void setPresenter(@Nonnull final Presenter presenter) {
+ this.presenter = presenter;
+ }
+
+ @Nonnull
+ public Widget asWidget() {
+ return this;
+ }
+
+ private void initNavigationLinks() {
+ navigationLinks = new NavigationLinks();
+
+ navigationLinks.firstButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent clickEvent) {
+ assert presenter != null;
+ presenter.onFirstButtonClicked();
+ }
+ });
+ navigationLinks.newerButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent clickEvent) {
+ assert presenter != null;
+ presenter.onNewerButtonClicked();
+ }
+ });
+ navigationLinks.refreshButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent clickEvent) {
+ assert presenter != null;
+ presenter.onRefreshButtonClicked();
+ }
+ });
+ navigationLinks.olderButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent clickEvent) {
+ assert presenter != null;
+ presenter.onOlderButtonClicked();
+ }
+ });
+ navigationLinks.lastButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent clickEvent) {
+ assert presenter != null;
+ presenter.onLastButtonClicked();
+ }
+ });
+ }
+
+ private void initEntryTableHeader() {
+ assert navigationLinks != null;
+
+ entryTableHeader.getColumnFormatter().setWidth(0, constans.browseTabDatatimeColumnWidth());
+ entryTableHeader.getColumnFormatter().setWidth(1, constans.browseTabLevelColumnWidth());
+ entryTableHeader.getColumnFormatter().setWidth(3, constans.browseTabNavigationLinksColumnWidth());
+
+ entryTableHeader.setText(0, 0, constans.browseTabDatatimeHeader());
+ entryTableHeader.setText(0, 1, constans.browseTabLevelHeader());
+ entryTableHeader.setText(0, 2, constans.browseTabMessageHeader());
+ entryTableHeader.setWidget(0, 3, navigationLinks);
+
+ entryTableHeader.getCellFormatter().setHorizontalAlignment(0, 3, HasHorizontalAlignment.ALIGN_RIGHT);
+ }
+
+ private void initSubscriptionTable() {
+ List<ColumnDefinition<Subscription>> columnDefinitions =
+ new ArrayList<ColumnDefinition<Subscription>>();
+
+ columnDefinitions.add(new ColumnDefinition<Subscription>() {
+
+ public String getContent(Subscription subscription) {
+ return subscription.getName();
+ }
+
+ public String getWidth() {
+ return null;
+ }
+ });
+
+ subscriptionTable.setColumnDefinitions(columnDefinitions);
+
+ subscriptionTable.addSelectRowHandler(new SelectRowHandler() {
+
+ public void onSelectRow(int row) {
+ assert presenter != null;
+ presenter.onSubcriptionItemClicked(row);
+ }
+ });
+ }
+
+ private void initEntryTable() {
+ List<ColumnDefinition<Entry>> columnDefinitions =
+ new ArrayList<ColumnDefinition<Entry>>();
+
+ columnDefinitions.add(new ColumnDefinition<Entry>() {
+
+ public String getContent(Entry entry) {
+ return DT_FORMATTER.format(entry.getEventTimestamp());
+ }
+
+ public String getWidth() {
+ return constans.browseTabDatatimeColumnWidth();
+ }
+ });
+ columnDefinitions.add(new ColumnDefinition<Entry>() {
+
+ public String getContent(Entry entry) {
+ return entry.getLevel();
+ }
+
+ public String getWidth() {
+ return constans.browseTabLevelColumnWidth();
+ }
+ });
+ columnDefinitions.add(new ColumnDefinition<Entry>() {
+
+ public String getContent(Entry entry) {
+ return entry.getTitle();
+ }
+
+ public String getWidth() {
+ return null;
+ }
+ });
+
+ entryTable.setColumnDefinitions(columnDefinitions);
+
+ entryTable.addSelectRowHandler(new SelectRowHandler() {
+
+ public void onSelectRow(int row) {
+ assert presenter != null;
+ presenter.onEntryItemClicked(row);
+ }
+ });
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/EntryTable.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/EntryTable.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/EntryTable.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/EntryTable.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.browser.Entry;
+
+public class EntryTable extends SelectableTable<Entry> {
+ public EntryTable() {
+ super(/* hotkeys enabled */ true);
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,61 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import javax.annotation.Nonnull;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiTemplate;
+import com.google.gwt.user.client.ui.Anchor;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Widget;
+
+/**
+ * A simple widget representing prev/next page navigation.
+ */
+class NavigationLinks extends Composite {
+
+ @UiTemplate("NavigationLinks.ui.xml")
+ interface Binder extends UiBinder<Widget, NavigationLinks> {
+ }
+
+ private static final Binder UI_BINDER = GWT.create(Binder.class);
+
+ @UiField @Nonnull
+ Anchor refreshButton;
+
+ @UiField @Nonnull
+ Anchor newerButton;
+
+ @UiField @Nonnull
+ Anchor olderButton;
+
+ @UiField @Nonnull
+ Anchor lastButton;
+
+ @UiField @Nonnull
+ Anchor firstButton;
+
+ public NavigationLinks() {
+ initWidget(UI_BINDER.createAndBindUi(this));
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.ui.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.ui.xml?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.ui.xml (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/NavigationLinks.ui.xml Sat Aug 7 16:57:58 2010
@@ -0,0 +1,47 @@
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+
+ <ui:with field='res'
+ type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/>
+
+ <g:HTMLPanel>
+ <g:Anchor styleName='{res.css.browserTabNavigationLink}' ui:field='firstButton' href='javascript:;'>
+ « first
+ </g:Anchor>
+
+ <g:Anchor styleName='{res.css.browserTabNavigationLink}' ui:field='olderButton' href='javascript:;'>
+ ‹ previous
+ </g:Anchor>
+
+ <g:Anchor styleName='{res.css.browserTabNavigationLink}' ui:field='refreshButton' href='javascript:;'>
+ refresh
+ </g:Anchor>
+
+ <g:Anchor styleName='{res.css.browserTabNavigationLink}' ui:field='newerButton' href='javascript:;'>
+ next ›
+ </g:Anchor>
+
+ <g:Anchor styleName='{res.css.browserTabNavigationLink}' ui:field='lastButton' href='javascript:;'>
+ last »
+ </g:Anchor>
+ </g:HTMLPanel>
+</ui:UiBinder>
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SelectableTable.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SelectableTable.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SelectableTable.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SelectableTable.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,253 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import java.util.ArrayList;
+import java.util.List;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.event.dom.client.KeyDownEvent;
+import com.google.gwt.event.dom.client.KeyDownHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.FocusPanel;
+import com.google.gwt.user.client.ui.HTMLTable.Cell;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.UIObject;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources;
+
+public class SelectableTable<T> extends Composite {
+
+ @Nonnull
+ private final ScrollPanel scroller;
+
+ @Nullable
+ private final FocusPanel focuser;
+
+ @Nonnull
+ private final FlexTable table;
+
+ @Nonnull
+ private final List<SelectRowHandler> selectRowHandlers;
+
+ private final boolean hotkeysEnabled;
+
+ private int selectedRowIndex;
+
+ private boolean isRowSelected;
+
+ private Label messageLabel;
+
+ @Nullable
+ private List<ColumnDefinition<T>> columnDefinitions;
+
+ @Nonnull
+ private LogBrowserResources resources = GWT.create(LogBrowserResources.class);
+
+ public SelectableTable(final boolean hotkeysEnabled) {
+ this.hotkeysEnabled = hotkeysEnabled;
+ selectRowHandlers = new ArrayList<SelectRowHandler>();
+
+ table = new FlexTable();
+ table.setCellPadding(0);
+ table.setCellSpacing(0);
+ table.setVisible(false);
+
+ messageLabel = new Label();
+ messageLabel.setVisible(false);
+
+ FlowPanel content = new FlowPanel();
+ content.add(messageLabel);
+ content.add(table);
+
+ scroller = new ScrollPanel();
+
+ if (hotkeysEnabled) {
+ focuser = new FocusPanel();
+ focuser.setWidth("99%");
+ focuser.add(content);
+
+ scroller.add(focuser);
+ } else {
+ focuser = null;
+
+ scroller.add(content);
+ }
+
+ addEventHandlers();
+
+ initWidget(scroller);
+ }
+
+ public void setMessageInsteadOfData(@Nonnull final String message, @Nullable final String styleName) {
+ messageLabel.setText(message);
+
+ messageLabel.setVisible(true);
+ table.setVisible(false);
+
+ if (styleName != null) {
+ messageLabel.setStyleName(styleName);
+ }
+ }
+
+ public void setData(@Nonnull final List<T> entries) {
+ assert columnDefinitions != null;
+
+ table.removeAllRows();
+
+ messageLabel.setVisible(false);
+ table.setVisible(true);
+
+ for (int i = 0; i < entries.size(); i++) {
+ T entry = entries.get(i);
+ for (int j = 0; j < columnDefinitions.size(); j++) {
+ ColumnDefinition<T> columnDefinition = columnDefinitions.get(j);
+ table.setText(i, j, columnDefinition.getContent(entry));
+ }
+ }
+
+ restoreRowSelection();
+
+ if (hotkeysEnabled) {
+ focuser.setFocus(true);
+ }
+ }
+
+ public void setColumnDefinitions(@Nonnull final List<ColumnDefinition<T>> columnDefinitions) {
+ this.columnDefinitions = columnDefinitions;
+ setColumnsWidth();
+ }
+
+ public void addSelectRowHandler(@Nonnull final SelectRowHandler selectRowHandler) {
+ selectRowHandlers.add(selectRowHandler);
+ }
+
+ private void addEventHandlers() {
+ table.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent event) {
+ performClickAction(event);
+ }
+ });
+
+ if (hotkeysEnabled) {
+ focuser.addKeyDownHandler(new KeyDownHandler() {
+
+ public void onKeyDown(@Nonnull final KeyDownEvent event) {
+ performKeyDownAction(event);
+ }
+ });
+ }
+ }
+
+ private void performClickAction(@Nonnull final ClickEvent event) {
+ Cell cell = table.getCellForEvent(event);
+ if (cell != null) {
+ int row = cell.getRowIndex();
+ selectRow(row);
+ }
+ }
+
+ private void performKeyDownAction(@Nonnull final KeyDownEvent event) {
+ if (isRowSelected) {
+ event.preventDefault();
+
+ if (event.isUpArrow()) {
+ selectRow(selectedRowIndex - 1);
+ } else if (event.isDownArrow()) {
+ selectRow(selectedRowIndex + 1);
+ }
+
+ ScrollMarker scrollMarker =
+ new ScrollMarker(table.getRowFormatter().getElement(selectedRowIndex));
+ scroller.ensureVisible(scrollMarker);
+ }
+ }
+
+ private void selectRow(final int row) {
+ if (row >= 0 && row < table.getRowCount()) {
+ if (isRowSelected) {
+ styleRow(selectedRowIndex, false);
+ }
+
+ selectedRowIndex = row;
+ styleRow(selectedRowIndex, true);
+ isRowSelected = true;
+
+ fireSelectRowEvent();
+ }
+ }
+
+ private void styleRow(final int row, final boolean selected) {
+ String style = resources.css().browserTabSelectedRow();
+
+ if (selected) {
+ table.getRowFormatter().addStyleName(row, style);
+ } else {
+ table.getRowFormatter().removeStyleName(row, style);
+ }
+ }
+
+ private void fireSelectRowEvent() {
+ for (SelectRowHandler selectRowHandler : selectRowHandlers) {
+ selectRowHandler.onSelectRow(selectedRowIndex);
+ }
+ }
+
+ private void restoreRowSelection() {
+ if (isRowSelected && selectedRowIndex < table.getRowCount()) {
+ selectRow(selectedRowIndex);
+ } else {
+ isRowSelected = false;
+ }
+ }
+
+ private void setColumnsWidth() {
+ assert columnDefinitions != null;
+ for (int j = 0; j < columnDefinitions.size(); j++) {
+ ColumnDefinition columnDefinition = columnDefinitions.get(j);
+ table.getColumnFormatter().setWidth(j, columnDefinition.getWidth());
+ }
+ }
+
+ private class ScrollMarker extends UIObject {
+ public ScrollMarker(Element element) {
+ setElement(element);
+ }
+ }
+
+ public static interface SelectRowHandler {
+ void onSelectRow(int row);
+ }
+
+ public static interface ColumnDefinition<T> {
+ String getContent(T t);
+
+ String getWidth();
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SubscriptionTable.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SubscriptionTable.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SubscriptionTable.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/browser/SubscriptionTable.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,28 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.browser;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+
+public class SubscriptionTable extends SelectableTable<Subscription> {
+ public SubscriptionTable() {
+ super(/* hotkeys not enabled */ false);
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserConstans.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserConstans.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserConstans.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserConstans.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,67 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.resources;
+
+import com.google.gwt.i18n.client.Constants;
+
+public interface LogBrowserConstans extends Constants {
+
+ @DefaultStringValue("Application Error")
+ String errorDialogTitle();
+
+ @DefaultStringValue("Continue")
+ String errorDialogContineButton();
+
+ @DefaultStringValue("No entries")
+ String browserTabNoEntries();
+
+ @DefaultStringValue("Date")
+ String browseTabDatatimeHeader();
+
+ @DefaultStringValue("160px")
+ String browseTabDatatimeColumnWidth();
+
+ @DefaultStringValue("Level")
+ String browseTabLevelHeader();
+
+ @DefaultStringValue("128px")
+ String browseTabLevelColumnWidth();
+
+ @DefaultStringValue("Message")
+ String browseTabMessageHeader();
+
+ @DefaultStringValue("350px")
+ String browseTabNavigationLinksColumnWidth();
+
+ @DefaultStringValue("Loading")
+ String browserTabLoading();
+
+ @DefaultStringValue("Add endpoint")
+ String settingsTabAddSubscriptionDialogTitle();
+
+ @DefaultStringValue("Edit endpoint")
+ String settingsTabEditSubscriptionDialogTitle();
+
+ @DefaultStringValue("Name can't be empty")
+ String settingsTabSubscriptionDialogEmptyName();
+
+ @DefaultStringValue("URL can't be empty")
+ String settingsTabSubscriptionDialogEmptyUrl();
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserCss.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserCss.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserCss.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserCss.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,75 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.resources;
+
+import com.google.gwt.resources.client.CssResource;
+
+public interface LogBrowserCss extends CssResource {
+
+ /* Error Dialog styles */
+ String errorDialog();
+ String errorDialogGlass();
+ String errorDialogTitle();
+ String errorDialogButtons();
+ String errorDialogErrorType();
+
+ /* Access control tab styles */
+ String accessControlTab();
+ String accessControlTabErrorMessage();
+ String accessControlTabRememberMeCheckbox();
+ String accessControlTabSignInButton();
+
+ /* Browser tab styles*/
+ String browserTabLoadingMessage();
+ String browserTabNoEntriesMessage();
+ String browserTabSelectedRow();
+ String browserTabSignOutButton();
+ String browserTabManageSubscriptionsButton();
+ String browserTabToolBar();
+ String browserTabEntryTableHeaders();
+ String browserTabEntrySelectableTable();
+ String browserTabSubscriptionsSideBar();
+ String browserTabSubscriptionsHeader();
+ String browserTabEntryDetailsSection();
+ String browserTabEntryDetailsContent();
+ String browserTabNavigationLink();
+
+ /* Settings tab styles */
+ String settingsTabHeader();
+ String settingsTabSignOutButton();
+ String settingsTabBackButton();
+ String settingsTabTitle();
+ String settingsTabToolBar();
+ String settingsTabContent();
+ String settingsTabFeedList();
+
+ /* Feed's entry (in settings tab) styles */
+ String feedEntry();
+ String feedEntryNameLabel();
+ String feedEntryUrlLabel();
+ String feedEntryButtons();
+ String feedEntryRemoveButton();
+ String feedEntryEditButton();
+
+ /* Edit feed dialog (in settings tab) styles */
+ String editFeedDialogErrorMessage();
+ String editFeedDialogButtons();
+ String editFeedDialogAddButton();
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserResources.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserResources.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserResources.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/LogBrowserResources.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,32 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.resources;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface LogBrowserResources extends ClientBundle {
+
+ @Source("logbrowser.css")
+ LogBrowserCss css();
+
+ @Source("loader.gif")
+ ImageResource loader();
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/loader.gif
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/loader.gif?rev=983258&view=auto
==============================================================================
Binary file - no diff available.
Propchange: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/loader.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/logbrowser.css
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/logbrowser.css?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/logbrowser.css (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/resources/logbrowser.css Sat Aug 7 16:57:58 2010
@@ -0,0 +1,287 @@
+/** Error Dialog **/
+
+.errorDialog {
+ background: none;
+ border: none;
+ padding: 10px;
+ width: 600px;
+ color: #FFFFFF;
+ font-size: 15px;
+ font-family: verdana;
+}
+
+.errorDialogGlass {
+ opacity: 0.75;
+}
+
+@if user.agent safari {
+
+ .errorDialogGlass {
+ opacity: 0.80;
+ }
+}
+
+@if user.agent ie6 ie8 {
+
+ /* IE just doesn't do opacity the way we want, make our dialog
+ * stand out in a way that it can't be missed against the page
+ */
+ .errorDialog {
+ color: black;
+ background: darkgray;
+ border: 10px groove lightgrey;
+ }
+}
+
+.errorDialogTitle {
+ font-size: 30px;
+ font-weight: bold;
+ margin-bottom: 15px;
+}
+
+.errorDialogErrorType {
+ font-weight: bold;
+ white-space: nowrap;
+ margin-bottom: 15px;
+}
+
+.errorDialogButtons {
+ width: 100%;
+ margin-top: 15px;
+}
+
+/* Access controler styles */
+
+.accessControlTab {
+ margin:50px auto;
+ width:25em;
+}
+
+.accessControlTab p > label {
+ width:7em;
+ float:left;
+ text-align:right;
+ margin-right:1em;
+ display:block;
+}
+
+.accessControlTab fieldset {
+ border:3px solid #BBCDF3;
+ width: 22.5em;
+}
+
+.accessControlTab legend {
+ padding:2px 6px;
+ font-weight:bolder;
+}
+
+.accessControlTabErrorMessage {
+ color:red;
+ margin-left: 8em;
+}
+
+.accessControlTabRememberMeCheckbox {
+ margin-left:8em;
+}
+
+.accessControlTabSignInButton button {
+ margin-left: 8em;
+}
+
+/* Browser tab styles */
+
+@sprite .browserTabLoadingMessage {
+ gwt-image: "loader";
+ background-repeat:no-repeat;
+ background-position:left;
+ color:grey;
+ font-size:large;
+ margin-top:1em;
+ text-align:right;
+ margin-left:auto;
+ margin-right:auto;
+ width:5.7em;
+ height:100%;
+}
+
+.browserTabNoEntriesMessage {
+ color:grey;
+ font-size:large;
+ height:auto;
+ margin-top:1em;
+ text-align:center;
+}
+
+.browserTabSelectedRow {
+ background: #adcce7;
+}
+
+.browserTabSelectedRow td {
+ border-top: 1px solid #88a4d6;
+ border-bottom: 1px solid #7b97d0;
+}
+
+.browserTabSignOutButton {
+ padding-top: 0.3em;
+ padding-right: 0.5em;
+ position: absolute;
+ text-align: right;
+}
+
+.browserTabManageSubscriptionsButton {
+ font-size: 11px;
+ color: #3366CC;
+ margin-left: 0.7em;
+}
+
+.browserTabToolBar {
+ border-left: 1px solid #999;
+ border-bottom: 1px solid #999;
+ cursor: pointer;
+ cursor: hand;
+}
+
+.browserTabEntryTableHeaders {
+ background: #E3E8F3 url(gwt/standard/images/hborder.png) repeat-x scroll 0 -2003px;
+ table-layout: fixed;
+ width: 100%;
+ height: 100%;
+ border-bottom: 2px solid #BBCDF3;
+ border-top: 3px solid #BBCDF3;
+}
+
+.browserTabEntryTableHeaders td {
+ text-shadow: #fff 0 2px 2px;
+ padding: 2px 0 1px 10px;
+}
+
+.browserTabEntrySelectableTable {
+ table-layout: fixed;
+ width: 100%;
+}
+
+.browserTabEntrySelectableTable table {
+ width: 100%;
+}
+
+.browserTabEntrySelectableTable td {
+ border-top: 1px solid #fff;
+ border-bottom: 1px solid #fff;
+ padding: 2px 0 2px 10px;
+}
+
+.browserTabSubscriptionsSideBar {
+ border-right: 1px solid #999999;
+}
+
+.browserTabSubscriptionsHeader {
+ background: #E3E8F3 url(gwt/standard/images/hborder.png) repeat-x scroll 0 -2003px;
+ border-bottom: 2px solid #BBCDF3;
+ border-top: 3px solid #BBCDF3;
+ padding-left:0.7em;
+ padding-top:0.25em;
+ padding-bottom:0.2em;
+}
+
+.browserTabEntryDetailsSection {
+ border: 1px solid #999999;
+}
+
+.browserTabEntryDetailsContent {
+ white-space:pre-wrap;
+ line-height: 150%;
+ padding: 20px 40px 20px 10px;
+ font-family: monospace, serif;
+}
+
+.browserTabNavigationLink {
+ margin: 0 8px;
+}
+
+/* Settings tab styles */
+
+.settingsTabHeader {
+ background: #FFCC66 none repeat scroll 0 0;
+ padding:0.3em;
+ margin-top:0.5em;
+}
+
+.settingsTabSignOutButton {
+ padding-top: 0.3em;
+ padding-right: 0.5em;
+ text-align: right;
+}
+
+.settingsTabBackButton {
+ margin-top: 0.5em;
+ display:inline;
+}
+
+.settingsTabTitle {
+ font-size: 140%;
+ margin: 0.1em 1.5em 0 0.3em;
+ font-weight: bold;
+ display:inline;
+}
+
+.settingsTabToolBar {
+ padding-left:1em;
+ padding-top:0.5em;
+ padding-bottom:0.5em;
+ background-color:#FFEDA3;
+}
+
+.settingsTabContent {
+ background-color:#FFF7D7;
+}
+
+.settingsTabFeedList {
+ width:100%;
+ padding:0.5em;
+}
+
+/* Feed's entry (in settings tab) styles */
+
+.feedEntry {
+ border-bottom:1px solid #FFCC66;
+ padding-bottom:0.5em;
+ width:100%;
+}
+
+.feedEntryNameLabel {
+ font-weight: bold;
+}
+
+.feedEntryUrlLabel {
+ color: grey;
+ float: left;
+}
+
+.feedEntryButtons {
+ text-align:right;
+ vertical-align:center;
+}
+
+.feedEntryRemoveButton {
+}
+
+.feedEntryEditButton {
+ margin-left: 0.5em;
+ margin-right: 1em;
+}
+
+/* Edit feed dialog styles */
+
+.editFeedDialogAddButton {
+ margin:0.4em;
+}
+
+.editFeedDialogButtons {
+ text-align:right;
+}
+
+.editFeedDialogErrorMessage {
+ color:red;
+}
+
+
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsPresenter.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsPresenter.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsPresenter.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsPresenter.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,147 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.settings;
+
+import java.util.HashMap;
+import java.util.Map;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.google.gwt.user.client.ui.HasValue;
+import com.google.gwt.user.client.ui.HasWidgets;
+import com.google.inject.Inject;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.EventBus;
+import org.apache.cxf.management.web.logging.logbrowser.client.event.GoToBrowserEvent;
+import org.apache.cxf.management.web.logging.logbrowser.client.event.SignOutEvent;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.SettingsFacade;
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.BasePresenter;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserConstans;
+
+public class SettingsPresenter extends BasePresenter
+ implements SettingsView.Presenter, SubscriptionDialog.Presenter {
+
+ @Nonnull
+ private final SettingsView view;
+
+ @Nonnull
+ private final SettingsFacade settingsFacade;
+
+ @Nonnull
+ private final SubscriptionDialog subscriptionDialog;
+
+ @Nonnull
+ private final LogBrowserConstans constans;
+
+ @Inject
+ public SettingsPresenter(@Nonnull final EventBus eventBus,
+ @Nonnull final SettingsView view,
+ @Nonnull final SettingsFacade settingsFacade,
+ @Nonnull final SubscriptionDialog subscriptionDialog,
+ @Nonnull final LogBrowserConstans constans) {
+ super(eventBus);
+
+ this.view = view;
+ this.settingsFacade = settingsFacade;
+ this.subscriptionDialog = subscriptionDialog;
+ this.constans = constans;
+
+ this.view.setPresenter(this);
+ this.subscriptionDialog.setPresenter(this);
+
+ updateSubscriptions();
+ }
+
+ public void go(@Nonnull final HasWidgets container) {
+ container.clear();
+ container.add(view.asWidget());
+ }
+
+ public void onAddSubscriptionButtonClicked() {
+ showSubscriptionDialog(constans.settingsTabAddSubscriptionDialogTitle(), null);
+ }
+
+ public void onEditSubscriptionButtonClicked(@Nonnull final Subscription subscription) {
+ showSubscriptionDialog(constans.settingsTabEditSubscriptionDialogTitle(), subscription);
+ }
+
+ public void onRemoveSubscriptionButtonClicked(@Nonnull final Subscription subscription) {
+ settingsFacade.removeSubscription(subscription);
+ updateSubscriptions();
+ }
+
+ public void onSaveButtonClicked(@Nonnull final HasValue<String> name,
+ @Nonnull final HasValue<String> url) {
+ Map<HasValue, String> errors = validate(name, url);
+
+ if (errors.isEmpty()) {
+ String nameValue = name.getValue();
+ String urlValue = url.getValue();
+
+ settingsFacade.updateSubscription(new Subscription(nameValue, urlValue));
+ updateSubscriptions();
+ subscriptionDialog.hide();
+ } else {
+ subscriptionDialog.setValidationErrors(errors);
+ }
+ }
+
+ public void onCancelButtonClicked() {
+ subscriptionDialog.hide();
+ }
+
+ public void onBackHyperlinkClicked() {
+ eventBus.fireEvent(new GoToBrowserEvent());
+ }
+
+ public void onSingOutHyperlinkClicked() {
+ eventBus.fireEvent(new SignOutEvent());
+ }
+
+ private void updateSubscriptions() {
+ view.setData(settingsFacade.getSubscriptions());
+ }
+
+ private void showSubscriptionDialog(@Nonnull final String title, @Nullable final Subscription data) {
+ subscriptionDialog.setTitle(title);
+ subscriptionDialog.setData(data);
+ subscriptionDialog.setValidationErrors(null);
+ subscriptionDialog.center();
+ subscriptionDialog.show();
+ }
+
+ private Map<HasValue, String> validate(@Nonnull final HasValue<String> name,
+ @Nonnull final HasValue<String> url) {
+ Map<HasValue, String> errors = new HashMap<HasValue, String>();
+
+ String nameValue = name.getValue();
+ if (nameValue == null || "".equals(nameValue)) {
+ errors.put(name, constans.settingsTabSubscriptionDialogEmptyName());
+ }
+
+ String urlValue = url.getValue();
+ if (urlValue == null || "".equals(urlValue)) {
+ errors.put(url, constans.settingsTabSubscriptionDialogEmptyUrl());
+ }
+
+ return errors;
+ }
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,45 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.settings;
+
+import java.util.List;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+import org.apache.cxf.management.web.logging.logbrowser.client.ui.View;
+
+public interface SettingsView extends View {
+
+ public interface Presenter {
+
+ void onAddSubscriptionButtonClicked();
+
+ void onEditSubscriptionButtonClicked(Subscription subscription);
+
+ void onRemoveSubscriptionButtonClicked(Subscription subscription);
+
+ void onBackHyperlinkClicked();
+
+ void onSingOutHyperlinkClicked();
+ }
+
+ void setData(List<Subscription> subscriptions);
+
+ void setPresenter(Presenter presenter);
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.ui.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.ui.xml?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.ui.xml (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsView.ui.xml Sat Aug 7 16:57:58 2010
@@ -0,0 +1,61 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you under the Apache License, Version 2.0 (the
+ "License"); you may not use this file except in compliance
+ with the License. You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing,
+ software distributed under the License is distributed on an
+ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ KIND, either express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+ -->
+
+<ui:UiBinder xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:g='urn:import:com.google.gwt.user.client.ui'>
+
+ <ui:with field='res'
+ type='org.apache.cxf.management.web.logging.logbrowser.client.ui.resources.LogBrowserResources'/>
+
+ <g:DockLayoutPanel unit='EM'>
+ <g:north size='7.2'>
+ <g:HTMLPanel>
+ <g:Hyperlink ui:field="singOutHyperlink" addStyleNames="{res.css.settingsTabSignOutButton}">
+ Sign out
+ </g:Hyperlink>
+ <div class="{res.css.settingsTabHeader}">
+ <g:Label addStyleNames="{res.css.settingsTabTitle}">
+ Settings
+ </g:Label>
+ <g:Hyperlink ui:field="backHyperlink" addStyleNames="{res.css.settingsTabBackButton}">
+ « Back to browse
+ </g:Hyperlink>
+ </div>
+ <div class="{res.css.settingsTabToolBar}">
+ <g:Button ui:field="addSubscriptionButton">
+ Add endpoint
+ </g:Button>
+ </div>
+ </g:HTMLPanel>
+ </g:north>
+
+ <g:center>
+ <g:ScrollPanel>
+ <g:HTMLPanel>
+ <div class="{res.css.settingsTabContent}">
+ <g:FlexTable ui:field="subscriptionsTable"
+ addStyleNames="{res.css.settingsTabFeedList}"/>
+ </div>
+ </g:HTMLPanel>
+ </g:ScrollPanel>
+ </g:center>
+ </g:DockLayoutPanel>
+
+</ui:UiBinder>
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsViewImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsViewImpl.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsViewImpl.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SettingsViewImpl.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,142 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.settings;
+
+import java.util.List;
+import javax.annotation.Nonnull;
+import javax.annotation.Nullable;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.uibinder.client.UiTemplate;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlexTable;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+
+public class SettingsViewImpl extends Composite implements SettingsView {
+
+ @UiTemplate("SettingsView.ui.xml")
+ interface SettingsViewUiBinder extends UiBinder<Widget, SettingsViewImpl> {
+ }
+
+ private static final SettingsViewUiBinder UI_BINDER = GWT.create(SettingsViewUiBinder.class);
+
+ @UiField @Nonnull
+ FlexTable subscriptionsTable;
+
+ @Nullable
+ private Presenter presenter;
+
+ public SettingsViewImpl() {
+ initWidget(UI_BINDER.createAndBindUi(this));
+ }
+
+ public void setData(@Nonnull final List<Subscription> subscriptions) {
+ subscriptionsTable.clear();
+
+ int row = 0;
+ for (final Subscription subscription : subscriptions) {
+ SubscriptionEntry subscriptionEntry = new SubscriptionEntry();
+
+ subscriptionEntry.nameLabel.setText(subscription.getName());
+ subscriptionEntry.urlLabel.setText(subscription.getUrl());
+
+ subscriptionEntry.editButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onEditSubscriptionButtonClicked(subscription);
+ }
+ });
+ subscriptionEntry.removeButton.addClickHandler(new ClickHandler() {
+
+ public void onClick(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onRemoveSubscriptionButtonClicked(subscription);
+ }
+ });
+
+ subscriptionsTable.setWidget(row, 0, subscriptionEntry);
+
+ row++;
+ }
+ }
+
+ @UiHandler("singOutHyperlink")
+ void onSingOutHyperlinkClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onSingOutHyperlinkClicked();
+ }
+
+ @UiHandler("backHyperlink")
+ void onBackHyperlinkClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onBackHyperlinkClicked();
+ }
+
+ @UiHandler("addSubscriptionButton")
+ void onAddSubscriptionButtonClicked(@Nonnull final ClickEvent event) {
+ assert presenter != null;
+ presenter.onAddSubscriptionButtonClicked();
+ }
+
+ public void setPresenter(@Nonnull final Presenter presenter) {
+ this.presenter = presenter;
+ }
+
+ @Nonnull
+ public Widget asWidget() {
+ return this;
+ }
+
+ protected static class SubscriptionEntry extends Composite {
+
+ @UiTemplate("SubscriptionEntry.ui.xml")
+ interface SubscriptionEntryUiBinder extends UiBinder<Widget, SubscriptionEntry> { }
+
+ private static final SubscriptionEntryUiBinder UI_BINDER =
+ GWT.create(SubscriptionEntryUiBinder.class);
+
+ @UiField @Nonnull
+ Label nameLabel;
+
+ @UiField @Nonnull
+ Label urlLabel;
+
+ @UiField @Nonnull
+ Button editButton;
+
+ @UiField @Nonnull
+ Button removeButton;
+
+ public SubscriptionEntry() {
+ initWidget(UI_BINDER.createAndBindUi(this));
+ }
+ }
+
+}
Added: cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialog.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialog.java?rev=983258&view=auto
==============================================================================
--- cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialog.java (added)
+++ cxf/sandbox/logbrowser/rt/management-web/src/main/java/org/apache/cxf/management/web/logging/logbrowser/client/ui/settings/SubscriptionDialog.java Sat Aug 7 16:57:58 2010
@@ -0,0 +1,50 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.management.web.logging.logbrowser.client.ui.settings;
+
+import java.util.Map;
+
+import com.google.gwt.user.client.ui.HasValue;
+
+import org.apache.cxf.management.web.logging.logbrowser.client.service.settings.Subscription;
+
+public interface SubscriptionDialog {
+
+ public interface Presenter {
+
+ void onSaveButtonClicked(HasValue<String> name, HasValue<String> url);
+
+ void onCancelButtonClicked();
+ }
+
+ void center();
+
+ void show();
+
+ void hide();
+
+ void setValidationErrors(Map<HasValue, String> errors);
+
+ void setTitle(String title);
+
+ void setData(Subscription subscription);
+
+ void setPresenter(Presenter presenter);
+}
\ No newline at end of file