[kune-commits] r1717 - trunk/src/main/java/cc/kune/gspace/client/viewers
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Mon Feb 27 20:43:45 CET 2012
Author: vjrj_
Date: 2012-02-27 20:43:44 +0100 (Mon, 27 Feb 2012)
New Revision: 1717
Added:
trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java
trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.ui.xml
Modified:
trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
Log:
tutorial viewer partial
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java 2012-02-26 23:04:45 UTC (rev 1716)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java 2012-02-27 19:43:44 UTC (rev 1717)
@@ -48,6 +48,7 @@
private final FlowPanel emptyPanel;
protected final GSpaceArmor gsArmor;
protected final I18nTranslationService i18n;
+ private final TutorialViewer tutorialViewer;
protected Widget widget;
public AbstractFolderViewerPanel(final GSpaceArmor gsArmor, final I18nTranslationService i18n,
@@ -63,6 +64,7 @@
emptyLabel.setStyleName("k-empty-msg");
emptyPanel.setStyleName("k-empty-folder-panel");
emptyPanel.add(emptyLabel);
+ tutorialViewer = new TutorialViewer();
contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
}
@@ -139,4 +141,9 @@
emptyLabel.setText(emptyMessage);
gsArmor.getDocContainer().add(emptyPanel);
}
+
+ @Override
+ public void showTutorial(final String url) {
+ gsArmor.getDocContainer().add(tutorialViewer.setUrl(url));
+ }
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java 2012-02-26 23:04:45 UTC (rev 1716)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java 2012-02-27 19:43:44 UTC (rev 1717)
@@ -34,4 +34,6 @@
void setSubheaderActions(GuiActionDescCollection actions);
void showEmptyMsg(String message);
+
+ void showTutorial(String url);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2012-02-26 23:04:45 UTC (rev 1716)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2012-02-27 19:43:44 UTC (rev 1717)
@@ -30,8 +30,8 @@
import cc.kune.common.client.ui.HasEditHandler;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.events.UserSignInEvent;
-import cc.kune.core.client.events.UserSignOutEvent;
import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent;
import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -180,11 +180,6 @@
// is already participant, show wave editor
final org.waveprotocol.box.webclient.client.Session waveSession = org.waveprotocol.box.webclient.client.Session.get();
if (waveSession != null && waveSession.isLoggedIn()) {
- // final String typeId = stateContent.getTypeId();
- // if (typeId.equals(BartersConstants.TYPE_BARTER)
- // || typeId.equals(MeetingsConstants.TYPE_MEETING)) {
- // NotifyUser.important("Currently we are experiencing problems with this tool. We'll fix ASAP...");
- // }
getView().setEditableContent(stateContent);
} else {
getView().setContent(stateContent);
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-02-26 23:04:45 UTC (rev 1716)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-02-27 19:43:44 UTC (rev 1717)
@@ -36,7 +36,7 @@
public class FolderViewerUtils {
private final ActionRegistryByType actionsRegistry;
- private final ContentCapabilitiesRegistry capabilitiesRegistry;
+ private final ContentCapabilitiesRegistry capabReg;
private final Provider<ClientFileDownloadUtils> downloadUtilsProvider;
private final I18nTranslationService i18n;
private final IconsRegistry iconsRegistry;
@@ -50,7 +50,7 @@
final Session session, final Provider<ClientFileDownloadUtils> downloadUtilsProvider,
final I18nTranslationService i18n, final ActionRegistryByType actionsRegistry,
final StateManager stateManager, final PathToolbarUtils pathToolbarUtils) {
- this.capabilitiesRegistry = capabilitiesRegistry;
+ this.capabReg = capabilitiesRegistry;
this.session = session;
this.downloadUtilsProvider = downloadUtilsProvider;
this.i18n = i18n;
@@ -68,19 +68,18 @@
final String name = content.getName();
final Object icon = mimeType != null ? getIcon(stateToken, typeId, mimeType) : getIcon(stateToken,
typeId, status);
- final String tooltip = getTooltip(stateToken, mimeType, capabilitiesRegistry.isDragable(typeId)
- && rights.isAdministrable());
+ final String tooltip = getTooltip(stateToken, mimeType,
+ capabReg.isDragable(typeId) && rights.isAdministrable());
if (status.equals(ContentStatus.inTheDustbin)
- && (!capabilitiesRegistry.showDeleted(typeId) && !session.getShowDeletedContent())) {
+ && (!capabReg.showDeleted(typeId) && !session.getShowDeletedContent())) {
// Don't show
// NotifyUser.info("Deleted, don't show");
} else {
final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken),
genId(parentStateToken), icon, name, tooltip, status, stateToken, modifiedOn,
- capabilitiesRegistry.isDragable(typeId) && rights.isAdministrable(),
- capabilitiesRegistry.isDropable(typeId) && rights.isAdministrable(),
- actionsRegistry.getCurrentActions(content, typeId, status, session.isLogged(), rights,
- ActionGroups.ITEM_MENU));
+ capabReg.isDragable(typeId) && rights.isAdministrable(), capabReg.isDropable(typeId)
+ && rights.isAdministrable(), actionsRegistry.getCurrentActions(content, typeId, status,
+ session.isLogged(), rights, ActionGroups.ITEM_MENU));
getView().addItem(item, new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
@@ -97,15 +96,11 @@
private void createChildItems(final ContainerDTO container, final AccessRights containerRights) {
if (container.getContents().size() + container.getChilds().size() == 0) {
- String msg = null;
+ // No elements here, so, we show a empty message
final String typeId = container.getTypeId();
- if (session.isLogged()) {
- // msg is already translated
- msg = capabilitiesRegistry.getEmptyMessagesRegistry().getContentTypeIcon(typeId);
- } else {
- msg = capabilitiesRegistry.getEmptyMessagesRegistryNotLogged().getContentTypeIcon(typeId);
- }
// msg is already translated
+ final String msg = session.isLogged() ? capabReg.getEmptyMessagesRegistry().getContentTypeIcon(
+ typeId) : capabReg.getEmptyMessagesRegistryNotLogged().getContentTypeIcon(typeId);
final String emptyMessage = TextUtils.empty(msg) ? i18n.t("This is empty.") : msg;
getView().showEmptyMsg(emptyMessage);
} else {
Added: trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.java 2012-02-27 19:43:44 UTC (rev 1717)
@@ -0,0 +1,29 @@
+package cc.kune.gspace.client.viewers;
+
+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.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.Widget;
+
+public class TutorialViewer extends Composite {
+
+ interface TutorialViewerUiBinder extends UiBinder<Widget, TutorialViewer> {
+ }
+
+ private static TutorialViewerUiBinder uiBinder = GWT.create(TutorialViewerUiBinder.class);
+
+ @UiField
+ Frame frame;
+
+ public TutorialViewer() {
+ initWidget(uiBinder.createAndBindUi(this));
+ }
+
+ public Widget setUrl(final String url) {
+ frame.setUrl(url);
+ return this;
+ }
+
+}
Added: trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/TutorialViewer.ui.xml 2012-02-27 19:43:44 UTC (rev 1717)
@@ -0,0 +1,16 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:style>
+ .frame {
+ margin: 5 auto;
+ padding: 0;
+ height: 100%;
+ display: block;
+ width: 100%;
+ border: none;
+ }
+ </ui:style>
+ <g:Frame styleName="{style.frame}"
+ ui:field="frame" />
+</ui:UiBinder>
\ No newline at end of file
More information about the kune-commits
mailing list