[kune-commits] r1016 - in trunk/src/main/java/org/ourproject/kune:
app/public/css chat/client platf/client/services
platf/client/ui platf/server/content platf/server/domain
workspace/client/ctxnav workspace/client/editor
workspace/client/licensefoot workspace/client/options
workspace/client/title
vjrj
vjrj at ourproject.org
Fri Dec 26 10:41:26 CET 2008
Author: vjrj
Date: 2008-12-26 10:41:23 +0100 (Fri, 26 Dec 2008)
New Revision: 1016
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java
trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
Log:
Some bug fixed
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/workspace.css 2008-12-26 09:41:23 UTC (rev 1016)
@@ -540,7 +540,6 @@
}
.kune-EditableLabel {
-
}
.kune-EditableLabel .kune-EditableLabel-editable {
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -138,8 +138,8 @@
final String initialWindowTitle = Window.getTitle();
chatOptions.userOptions = userChatOptions;
if (emiteUIProvider.get().isDialogNotStarted()) {
- emiteUIProvider.get().start(userChatOptions, chatOptions.httpBase, chatOptions.roomHost,
- initialWindowTitle, avatarProvider, i18n.t("Chat"));
+ emiteUIProvider.get().start(userChatOptions, chatOptions.httpBase, chatOptions.domain,
+ chatOptions.roomHost, avatarProvider, i18n.t("Chat"));
} else {
emiteUIProvider.get().setEnableStatusUI(true);
emiteUIProvider.get().refreshUserInfo(chatOptions.userOptions);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -59,8 +59,7 @@
public void doSessionExpired() {
onSessionExpired.fire();
- getWorkspaceSkeleton().showAlertMessage(i18n.t("Session expired"),
- i18n.t("Your session has expired. Please log in again."));
+ Site.info("Your session has expired. Please log in again.");
}
public WorkspaceSkeleton getWorkspaceSkeleton() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -19,18 +19,15 @@
*/
package org.ourproject.kune.platf.client.ui;
-import com.calclab.suco.client.listener.Event2;
-import com.calclab.suco.client.listener.Listener2;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.ChangeListener;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FocusListener;
-import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.MouseListenerAdapter;
-import com.google.gwt.user.client.ui.TextBox;
import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.MessageBox;
+import com.gwtext.client.widgets.MessageBoxConfig;
+ at Deprecated
public class EditableIconLabel extends Composite {
private boolean useDoubleClick;
@@ -40,15 +37,10 @@
private EditableClickListener editableListener;
private MouseListenerAdapter mouseOverListener;
private final AbstractLabel label;
- @SuppressWarnings("unused")
private String renameDialogTitle;
- @SuppressWarnings("unused")
private String renameDialogLabel;
private String doubleClickToRenameLabel;
private String clickToRenameLabel;
- private Event2<String, String> onEdit;
- private TextBox editor;
- private HorizontalPanel hp;
public EditableIconLabel(final AbstractImagePrototype icon, final String text, final boolean useDoubleClick,
final EditableClickListener editableListenerOrig) {
@@ -60,7 +52,6 @@
final boolean useDoubleClick, final EditableClickListener editableListenerOrig) {
label = new IconHyperlink(icon, text, targetHistoryToken);
init(text, useDoubleClick, editableListenerOrig);
- this.onEdit = new Event2<String, String>("onEdit");
}
public EditableIconLabel(final EditableClickListener editableListener) {
@@ -71,7 +62,6 @@
final EditableClickListener editableListenerOrig) {
label = new LabelWrapper(text, wordWrap);
init(text, useDoubleClick, editableListenerOrig);
- this.onEdit = new Event2<String, String>("onEdit");
}
public EditableIconLabel(final String text, final boolean useDoubleClick,
@@ -91,10 +81,6 @@
return label.getText();
}
- public void onEdit(final Listener2<String, String> slot) {
- onEdit.add(slot);
- }
-
public void restoreOldText() {
label.setText(oldText);
this.currentText = this.oldText;
@@ -131,12 +117,10 @@
this.editableListener = editableListener;
}
- @Deprecated
public void setRenameDialogLabel(final String renameDialogLabel) {
this.renameDialogLabel = renameDialogLabel;
}
- @Deprecated
public void setRenameDialogTitle(final String renameDialogTitle) {
this.renameDialogTitle = renameDialogTitle;
}
@@ -147,34 +131,21 @@
label.setText(text);
}
- private void afterEdit() {
- String text = editor.getText();
- onEdit.fire(currentText, text);
- editor.setVisible(false);
- editor.setReadOnly(true);
- label.setVisible(true);
- label.removeStyleDependentName("high");
- }
-
private void init(final String text, final boolean useDoubleClick, final EditableClickListener editableListenerOrig) {
doubleClickToRenameLabel = "Double click to rename";
clickToRenameLabel = "Click to rename";
renameDialogLabel = "Write a new name:";
renameDialogTitle = "Rename";
- hp = new HorizontalPanel();
- hp.add((Widget) label);
- initWidget(hp);
+ initWidget((Widget) label);
this.currentText = text;
this.oldText = text;
this.useDoubleClick = useDoubleClick;
this.editableListener = editableListenerOrig;
- this.onEdit = new Event2<String, String>("onEdit");
this.listener = new ClickListener() {
public void onClick(final Widget sender) {
- showEditor();
+ showEditableDialog();
}
};
-
mouseOverListener = new MouseListenerAdapter() {
@Override
public void onMouseEnter(final Widget sender) {
@@ -199,32 +170,30 @@
label.removeMouseListener(mouseOverListener);
}
- private void showEditor() {
- int hpWidth = hp.getParent().getOffsetWidth();
- label.setVisible(false);
- if (editor == null) {
- editor = new TextBox();
- editor.setStyleName("k-eil-edit");
- hp.add(editor);
- editor.addFocusListener(new FocusListener() {
- public void onFocus(Widget sender) {
- }
-
- public void onLostFocus(Widget sender) {
- afterEdit();
- }
- });
- editor.addChangeListener(new ChangeListener() {
- public void onChange(Widget sender) {
- afterEdit();
- }
- });
- }
- editor.setReadOnly(false);
- editor.setPixelSize(hpWidth < 100 ? 100 : hpWidth, 21);
- editor.setText(currentText);
- editor.setVisible(true);
- editor.setFocus(true);
+ private void showEditableDialog() {
+ MessageBox.show(new MessageBoxConfig() {
+ {
+ // i18n
+ setClosable(true);
+ setModal(true);
+ setWidth(300);
+ setDefaultTextHeight(2);
+ setButtons(MessageBox.OKCANCEL);
+ setTitle(renameDialogTitle);
+ setMsg(renameDialogLabel);
+ setCallback(new MessageBox.PromptCallback() {
+ public void execute(final String btnID, final String text) {
+ if (btnID.equals("ok") && text != null) {
+ editableListener.onEdited(text);
+ } else {
+ // Do nothing
+ }
+ }
+ });
+ setMultiline(true);
+ setValue(currentText);
+ }
+ });
}
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -0,0 +1,199 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.platf.client.ui;
+
+import com.calclab.suco.client.listener.Event2;
+import com.calclab.suco.client.listener.Listener2;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.ChangeListener;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FocusListener;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.MouseListenerAdapter;
+import com.google.gwt.user.client.ui.TextBox;
+import com.google.gwt.user.client.ui.Widget;
+
+public class IconLabelEditable extends Composite {
+
+ private boolean useDoubleClick;
+ private ClickListener listener;
+ private String currentText;
+ private String oldText;
+ private MouseListenerAdapter mouseOverListener;
+ private final AbstractLabel label;
+ private String doubleClickToRenameLabel;
+ private String clickToRenameLabel;
+ private Event2<String, String> onEdit;
+ private TextBox editor;
+ private HorizontalPanel hp;
+
+ public IconLabelEditable() {
+ this("");
+ }
+
+ public IconLabelEditable(final AbstractImagePrototype icon, final String text, final boolean useDoubleClick) {
+ label = new IconLabel(icon, text);
+ init(text, useDoubleClick);
+ }
+
+ public IconLabelEditable(final AbstractImagePrototype icon, final String text, final String targetHistoryToken,
+ final boolean useDoubleClick) {
+ label = new IconHyperlink(icon, text, targetHistoryToken);
+ init(text, useDoubleClick);
+ }
+
+ public IconLabelEditable(final String text) {
+ this(text, false);
+ }
+
+ public IconLabelEditable(final String text, final boolean useDoubleClick) {
+ this(text, false, false);
+ }
+
+ public IconLabelEditable(final String text, final boolean wordWrap, final boolean useDoubleClick) {
+ label = new LabelWrapper(text, wordWrap);
+ init(text, useDoubleClick);
+ }
+
+ public String getText() {
+ return label.getText();
+ }
+
+ public void onEdit(final Listener2<String, String> slot) {
+ onEdit.add(slot);
+ }
+
+ public void restoreOldText() {
+ label.setText(oldText);
+ this.currentText = this.oldText;
+ }
+
+ public void setClickToRenameLabel(final String clickToRenameLabel) {
+ this.clickToRenameLabel = clickToRenameLabel;
+ }
+
+ public void setDoubleClickToRenameLabel(final String doubleClickToRenameLabel) {
+ this.doubleClickToRenameLabel = doubleClickToRenameLabel;
+ }
+
+ public void setEditable(final boolean editable) {
+ reset();
+ if (editable) {
+ if (useDoubleClick) {
+ label.setTitle(doubleClickToRenameLabel);
+ label.addDoubleClickListener(listener);
+ } else {
+ label.setTitle(clickToRenameLabel);
+ label.addClickListener(listener);
+ }
+ label.addStyleDependentName("editable");
+ // label.addDoubleClickListener(listener);
+ label.addMouseListener(mouseOverListener);
+ } else {
+ label.setTitle(null);
+ label.addStyleDependentName("noneditable");
+ }
+ }
+
+ public void setText(final String text) {
+ this.oldText = this.currentText;
+ this.currentText = text;
+ label.setText(text);
+ }
+
+ private void afterEdit() {
+ String text = editor.getText();
+ onEdit.fire(currentText, text);
+ editor.setVisible(false);
+ editor.setReadOnly(true);
+ label.setVisible(true);
+ label.removeStyleDependentName("high");
+ }
+
+ private void init(final String text, final boolean useDoubleClick) {
+ this.onEdit = new Event2<String, String>("onEdit");
+ doubleClickToRenameLabel = "Double click to rename";
+ clickToRenameLabel = "Click to rename";
+ hp = new HorizontalPanel();
+ hp.add((Widget) label);
+ initWidget(hp);
+ this.currentText = text;
+ this.oldText = text;
+ this.useDoubleClick = useDoubleClick;
+ this.listener = new ClickListener() {
+ public void onClick(final Widget sender) {
+ showEditor();
+ }
+ };
+
+ mouseOverListener = new MouseListenerAdapter() {
+ @Override
+ public void onMouseEnter(final Widget sender) {
+ label.addStyleDependentName("high");
+ }
+
+ @Override
+ public void onMouseLeave(final Widget sender) {
+ label.removeStyleDependentName("high");
+ }
+ };
+ label.setStylePrimaryName("kune-EditableLabel");
+ label.addMouseListener(mouseOverListener);
+ setEditable(false);
+ }
+
+ private void reset() {
+ label.removeStyleDependentName("noneditable");
+ label.removeStyleDependentName("editable");
+ label.removeClickListener(listener);
+ label.removeDoubleClickListener(listener);
+ label.removeMouseListener(mouseOverListener);
+ }
+
+ private void showEditor() {
+ int hpWidth = hp.getParent().getOffsetWidth();
+ label.setVisible(false);
+ if (editor == null) {
+ editor = new TextBox();
+ editor.setStyleName("k-eil-edit");
+ hp.add(editor);
+ editor.addFocusListener(new FocusListener() {
+ public void onFocus(Widget sender) {
+ }
+
+ public void onLostFocus(Widget sender) {
+ afterEdit();
+ }
+ });
+ editor.addChangeListener(new ChangeListener() {
+ public void onChange(Widget sender) {
+ editor.setFocus(false);
+ }
+ });
+ }
+ editor.setReadOnly(false);
+ editor.setPixelSize(hpWidth < 100 ? 100 : hpWidth, 21);
+ editor.setText(currentText);
+ editor.setVisible(true);
+ editor.setFocus(true);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/content/ContainerManagerDefault.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -60,14 +60,15 @@
public Container createFolder(final Group group, final Container parent, final String name,
final I18nLanguage language, String typeId) {
- findInexistentName(parent, name);
+ FilenameUtils.checkBasicFilename(name);
+ String newtitle = findInexistentName(parent, name);
final List<Container> parentAbsolutePath = parent.getAbsolutePath();
final List<Container> childAbsolutePath = new ArrayList<Container>();
for (Container parentRef : parentAbsolutePath) {
childAbsolutePath.add(parentRef);
}
- final Container child = new Container(name, group, parent.getToolName());
+ final Container child = new Container(newtitle, group, parent.getToolName());
childAbsolutePath.add(child);
child.setLanguage(language);
child.setAbsolutePath(childAbsolutePath);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Container.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -20,10 +20,12 @@
package org.ourproject.kune.platf.server.domain;
import java.util.ArrayList;
+import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
+import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
@@ -35,6 +37,7 @@
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
+import javax.persistence.OrderBy;
import javax.persistence.Table;
import javax.persistence.Transient;
@@ -81,13 +84,16 @@
@JoinColumn
private Container parent;
+ @OrderBy("createdOn DESC")
@OneToMany(mappedBy = "parent", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Container> childs;
@ContainedIn
+ @OrderBy("createdOn DESC")
@OneToMany(mappedBy = "container", cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Content> contents;
+ @OrderBy("createdOn DESC")
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
private List<Container> absolutePath;
@@ -97,6 +103,12 @@
@OneToOne(cascade = CascadeType.ALL)
private AccessLists accessLists;
+ @Basic(optional = false)
+ private Long createdOn;
+
+ @Basic(optional = true)
+ private Date deletedOn;
+
public Container() {
this(null, null, null);
}
@@ -108,6 +120,7 @@
this.contents = new HashSet<Content>();
this.childs = new HashSet<Container>();
this.absolutePath = new ArrayList<Container>();
+ this.createdOn = System.currentTimeMillis();
}
public void addChild(final Container child) {
@@ -152,6 +165,14 @@
return contents;
}
+ public Long getCreatedOn() {
+ return createdOn;
+ }
+
+ public Date getDeletedOn() {
+ return deletedOn;
+ }
+
public Long getId() {
return id;
}
@@ -233,6 +254,14 @@
this.contents = contents;
}
+ public void setCreatedOn(Long createdOn) {
+ this.createdOn = createdOn;
+ }
+
+ public void setDeletedOn(Date deletedOn) {
+ this.deletedOn = deletedOn;
+ }
+
public void setId(final Long id) {
this.id = id;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigator.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -41,8 +41,6 @@
void setEditOnNextStateChange(boolean edit);
- void setFireOnTextChange(boolean visible);
-
void setItemStatus(StateToken stateToken, ContentStatusDTO status);
void setState(StateContainerDTO state, boolean selectItem);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPanel.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -208,17 +208,15 @@
this.isEditable = editable;
}
- public void setFireOnTextChange(final boolean fireOnTextChange) {
- this.fireOnTextChange = fireOnTextChange;
- }
-
public void setItemStatus(final String id, ContentStatusDTO status) {
setNodeStatus(getNode(id), status);
}
public void setItemText(final String genId, final String text) {
final TreeNode node = getNode(genId);
+ setFireOnTextChange(false);
node.setText(text);
+ setFireOnTextChange(true);
}
public void setRootItem(final String id, final String text, final StateToken stateToken) {
@@ -321,18 +319,23 @@
return node.getAttribute("href").substring(1);
}
+ private void setFireOnTextChange(final boolean fireOnTextChange) {
+ this.fireOnTextChange = fireOnTextChange;
+ }
+
private void setNodeStatus(final TreeNode node, ContentStatusDTO status) {
switch (status) {
+ // FIXME: while not finished
case publishedOnline:
- node.setCls("k-textnormal");
+ // node.setCls("k-textnormal");
break;
case inTheDustbin:
case rejected:
- node.setCls("k-textlinethrough");
+ // node.setCls("k-textlinethrough");
break;
case editingInProgress:
case submittedForEvaluation:
- node.setCls("k-textunderline");
+ // node.setCls("k-textunderline");
break;
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -141,10 +141,6 @@
return editOnNextStateChange;
}
- public void onItemRename(final String token, final String newName, final String oldName) {
- renameAction.rename(new StateToken(token), oldName, newName);
- }
-
public void refresh(final StateToken stateToken) {
contentServiceProvider.get().getContent(session.getUserHash(), stateToken,
new AsyncCallbackSimple<StateAbstractDTO>() {
@@ -164,10 +160,6 @@
editOnNextStateChange = edit;
}
- public void setFireOnTextChange(boolean visible) {
- view.setFireOnTextChange(visible);
- }
-
public void setItemStatus(final StateToken stateToken, ContentStatusDTO status) {
view.setItemStatus(genId(stateToken), status);
}
@@ -244,6 +236,10 @@
toolbar.attach();
}
+ protected void onItemRename(final String token, final String newName, final String oldName) {
+ renameAction.rename(new StateToken(token), oldName, newName);
+ }
+
private ActionItemCollection<StateToken> addItem(final String title, final String contentTypeId,
final BasicMimeTypeDTO mimeType, final ContentStatusDTO status, final StateToken stateToken,
final StateToken parentStateToken, final AccessRightsDTO rights, final boolean isNodeSelected) {
@@ -265,17 +261,13 @@
private void confRenameListener() {
Listener2<StateToken, String> onSuccess = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String newName) {
- view.setFireOnTextChange(false);
setItemText(token, newName);
- view.setFireOnTextChange(true);
}
};
renameAction.onSuccess(onSuccess);
Listener2<StateToken, String> onFail = new Listener2<StateToken, String>() {
public void onEvent(StateToken token, String oldName) {
- view.setFireOnTextChange(false);
setItemText(token, oldName);
- view.setFireOnTextChange(true);
}
};
renameAction.onFail(onFail);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorView.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -39,8 +39,6 @@
void setEditable(boolean editable);
- void setFireOnTextChange(boolean fire);
-
void setItemStatus(String id, ContentStatusDTO status);
void setItemText(String id, String text);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -23,6 +23,7 @@
import org.ourproject.kune.platf.client.actions.ActionItem;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
@@ -49,7 +50,7 @@
private Listener<String> onSave;
private Listener0 onEditCancelled;
private final ActionToolbar<StateToken> toolbar;
- private ActionToolbarButtonDescriptor<StateToken> save;
+ private ActionToolbarMenuDescriptor<StateToken> save;
private ActionToolbarButtonDescriptor<StateToken> close;
private final I18nUITranslationService i18n;
private final BeforeActionListener beforeStateChangeListener;
@@ -193,13 +194,14 @@
}
private void createActions() {
- save = new ActionToolbarButtonDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
+ save = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Viewer, ActionToolbarPosition.topbar,
new Listener<StateToken>() {
public void onEvent(final StateToken token) {
onSave();
}
});
save.setTextDescription(i18n.tWithNT("Save", "used in button"));
+ save.setParentMenuTitle(i18n.t("File"));
save.setId(SAVE_ID);
// save.setIconUrl("images/");
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -21,7 +21,6 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -100,7 +99,7 @@
public void showLicense(final String groupName, final LicenseDTO licenseDTO) {
String licenseText = i18n.t("© [%s], under license: [%s]", groupName, licenseDTO.getLongName());
licenseLabel.setText(licenseText);
- KuneUiUtils.setQuickTip(licenseLabel, licenseText);
+ // KuneUiUtils.setQuickTip(licenseLabel, licenseText);
licenseImage.setUrl(licenseDTO.getImageUrl());
fade(false);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -42,6 +42,7 @@
@Override
public void createAndShow() {
+ // FIXME: use onAfterCreate in Factory/Module
entityPreferencesGroup.createAll();
super.createAndShow();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-12-23 22:22:43 UTC (rev 1015)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-12-26 09:41:23 UTC (rev 1016)
@@ -19,8 +19,7 @@
*/
package org.ourproject.kune.workspace.client.title;
-import org.ourproject.kune.platf.client.ui.EditableClickListener;
-import org.ourproject.kune.platf.client.ui.EditableIconLabel;
+import org.ourproject.kune.platf.client.ui.IconLabelEditable;
import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
@@ -29,16 +28,12 @@
public class EntityTitlePanel implements EntityTitleView {
public static final String ENTITY_TITLE_RIGHT_TITLE = "k-entity-title-title";
- private final EditableIconLabel titleLabel;
+ private final IconLabelEditable titleLabel;
private final Image icon;
public EntityTitlePanel(final WorkspaceSkeleton ws, final EntityTitlePresenter presenter) {
icon = new Image();
- titleLabel = new EditableIconLabel(new EditableClickListener() {
- public void onEdited(final String newName) {
- }
- });
-
+ titleLabel = new IconLabelEditable();
titleLabel.onEdit(new Listener2<String, String>() {
public void onEvent(String oldName, String newName) {
presenter.onTitleRename(oldName, newName);
More information about the kune-commits
mailing list