Permalink
Browse files

Created v1.5.2 tag

git-svn-id: https://svn.apache.org/repos/asf/pivot/tags/v1.5.2@1022903 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
2 parents 646c09f + 6c5deca commit 93b3daafce2d35af2cc37fa9318bc5fe50a1fc2f Todd Volkert committed Oct 15, 2010
View
2 README
@@ -88,4 +88,4 @@ Documentation
Pivot home page: http://pivot.apache.org/
Demos: http://pivot.apache.org/demos/
Tutorials: http://pivot.apache.org/tutorials/
-Javadoc: http://pivot.apache.org/1.5.2/docs/api/
+Javadoc: http://pivot.apache.org/1.5.1/docs/api/
@@ -613,8 +613,8 @@ private void updateCalendar() {
Locale locale = calendar.getLocale();
GregorianCalendar gregorianCalendar = new GregorianCalendar(locale);
gregorianCalendar.set(year, month, 1);
- int firstIndex = gregorianCalendar.get(java.util.Calendar.DAY_OF_WEEK)
- - gregorianCalendar.getFirstDayOfWeek();
+ int firstIndex = (7 + gregorianCalendar.get(java.util.Calendar.DAY_OF_WEEK)
+ - gregorianCalendar.getFirstDayOfWeek()) % 7;
int lastIndex = firstIndex + gregorianCalendar.getActualMaximum(java.util.Calendar.DAY_OF_MONTH);
// Determine the last day of last month
@@ -29,8 +29,11 @@
* Saves an edit that is in progress by updating the appropriate data
* object. It is up to implementations to define the behavior when
* <tt>isEditing() == false</tt>.
+ *
+ * @return
+ * <tt>true</tt> if the changes were successfully saved; <tt>false</tt> otherwise.
*/
- public void saveChanges();
+ public boolean saveChanges();
/**
* Cancels an edit that is in progress by reverting any edits the user has
@@ -153,11 +153,12 @@ public boolean mouseDown(Container container, Mouse.Button button, int x, int y)
Display display = (Display)container;
Window window = (Window)display.getComponentAt(x, y);
+ boolean consumed = false;
if (popup != window) {
- saveChanges();
+ consumed = !saveChanges();
}
- return false;
+ return consumed;
}
@Override
@@ -261,7 +262,7 @@ public boolean isEditing() {
*/
@SuppressWarnings("unchecked")
@Override
- public void saveChanges() {
+ public boolean saveChanges() {
if (!isEditing()) {
throw new IllegalStateException();
}
@@ -274,6 +275,7 @@ public void saveChanges() {
String text = textInput.getText();
Vote vote = itemEditorListeners.previewSaveChanges(this, listView, index, text);
+ boolean saved = false;
if (vote == Vote.APPROVE) {
List<Object> listData = (List<Object>)listView.getListData();
ListItem listItem = (ListItem)listData.get(index);
@@ -295,9 +297,12 @@ public void saveChanges() {
}
itemEditorListeners.changesSaved(this, listView, index);
+ saved = true;
} else if (vote == Vote.DENY) {
itemEditorListeners.saveChangesVetoed(this, vote);
}
+
+ return saved;
}
/**
@@ -172,11 +172,12 @@ public boolean mouseDown(Container container, Mouse.Button button, int x, int y)
Display display = (Display)container;
Window window = (Window)display.getComponentAt(x, y);
+ boolean consumed = false;
if (popup != window) {
- saveChanges();
+ consumed = !saveChanges();
}
- return false;
+ return consumed;
}
@Override
@@ -281,7 +282,7 @@ public boolean isEditing() {
*/
@SuppressWarnings("unchecked")
@Override
- public void saveChanges() {
+ public boolean saveChanges() {
if (!isEditing()) {
throw new IllegalStateException();
}
@@ -301,6 +302,7 @@ public void saveChanges() {
Vote vote = rowEditorListeners.previewSaveChanges(this, tableView, rowIndex,
columnIndex, changes);
+ boolean saved = false;
if (vote == Vote.APPROVE) {
List<Object> tableData = (List<Object>)tableView.getTableData();
@@ -330,9 +332,12 @@ public void saveChanges() {
}
rowEditorListeners.changesSaved(this, tableView, rowIndex, columnIndex);
+ saved = true;
} else if (vote == Vote.DENY) {
rowEditorListeners.saveChangesVetoed(this, vote);
}
+
+ return saved;
}
/**
@@ -337,7 +337,7 @@ public void editRow() {
}
@SuppressWarnings("unchecked")
- public void saveChanges() {
+ public boolean saveChanges() {
// Preview the changes
HashMap<String, Object> changes = new HashMap<String, Object>();
tablePane.store(changes);
@@ -376,6 +376,8 @@ public void saveChanges() {
saving = false;
rowEditorListeners.saveChangesVetoed(TableViewRowEditor.this, vote);
}
+
+ return saving;
}
public void cancelEdit() {
@@ -428,6 +430,8 @@ public boolean mouseMove(Container container, int x, int y) {
@Override
public boolean mouseDown(Container container, Mouse.Button button, int x, int y) {
+ boolean consumed = opening;
+
if (!opening
&& !closing) {
// If the event occurred outside the popup, close the popup
@@ -436,11 +440,11 @@ public boolean mouseDown(Container container, Mouse.Button button, int x, int y)
if (window != this &&
(window == null || !isOwner(window))) {
- saveChanges();
+ consumed = !saveChanges();
}
}
- return opening;
+ return consumed;
}
@Override
@@ -750,12 +754,12 @@ public boolean isEditing() {
* {@inheritDoc}
*/
@Override
- public void saveChanges() {
+ public boolean saveChanges() {
if (editorPopup == null) {
throw new IllegalStateException("No edit in progress.");
}
- editorPopup.saveChanges();
+ return editorPopup.saveChanges();
}
/**
@@ -135,11 +135,12 @@ public boolean mouseDown(Container container, Mouse.Button button, int x, int y)
Display display = (Display)container;
Window window = (Window)display.getComponentAt(x, y);
+ boolean consumed = false;
if (popup != window) {
- saveChanges();
+ consumed = !saveChanges();
}
- return false;
+ return consumed;
}
@Override
@@ -292,7 +293,7 @@ public boolean isEditing() {
*/
@SuppressWarnings("unchecked")
@Override
- public void saveChanges() {
+ public boolean saveChanges() {
if (!isEditing()) {
throw new IllegalStateException();
}
@@ -305,6 +306,7 @@ public void saveChanges() {
String text = textInput.getText();
Vote vote = nodeEditorListeners.previewSaveChanges(this, treeView, path, text);
+ boolean saved = false;
if (vote == Vote.APPROVE) {
// Update the node data
List<?> treeData = treeView.getTreeData();
@@ -337,9 +339,12 @@ public void saveChanges() {
}
nodeEditorListeners.changesSaved(this, treeView, path);
+ saved = true;
} else if (vote == Vote.DENY) {
nodeEditorListeners.saveChangesVetoed(this, vote);
}
+
+ return saved;
}
/**

0 comments on commit 93b3daa

Please sign in to comment.