\r
private final List<File> files;\r
\r
- private Boolean initialVersioned;\r
-\r
-\r
/**\r
* The widget's constructor.\r
*\r
* @param _files\r
*/\r
public FilesPropertiesDialog(Pithos _app, final List<File> _files) {\r
- super();\r
+ super(_app);\r
\r
files = _files;\r
-// int versionedNum = 0;\r
-// for (File fr : files)\r
-// if (fr.isVersioned()) versionedNum++;\r
-// Boolean versioned = null;\r
-// if (versionedNum == 0)\r
-// versioned = false;\r
-// if (versionedNum == files.size())\r
-// versioned = true;\r
-\r
-// initialVersioned = versioned;\r
-// versionedCheck = new TristateCheckBox(versioned);\r
\r
// Set the dialog's caption.\r
setText("Files properties");\r
\r
inner.add(createGeneralPanel(), "General");\r
\r
- final VerticalPanel verPanel = new VerticalPanel();\r
-\r
-// final HorizontalPanel vPanel = new HorizontalPanel();\r
-// vPanel.setSpacing(8);\r
-// vPanel.addStyleName("pithos-TabPanelBottom");\r
-// vPanel.add(new Label("Versioned"));\r
-// vPanel.add(versionedCheck);\r
-//\r
-// verPanel.add(vPanel);\r
-\r
- inner.add(verPanel, "Versions");\r
inner.selectTab(0);\r
outer.add(inner);\r
\r
// when the button is clicked.\r
final Button ok = new Button("OK", new ClickHandler() {\r
@Override\r
- public void onClick(ClickEvent event) {\r
+ public void onClick(@SuppressWarnings("unused") ClickEvent event) {\r
accept();\r
closeDialog();\r
}\r
// dialog when the button is clicked.\r
final Button cancel = new Button("Cancel", new ClickHandler() {\r
@Override\r
- public void onClick(ClickEvent event) {\r
+ public void onClick(@SuppressWarnings("unused") ClickEvent event) {\r
closeDialog();\r
}\r
});\r
else\r
generalTable.setText(1, 1, "-");\r
\r
- // Find if tags are identical\r
-// List<String> tagsList = files.get(0).getTags();\r
-// List<String> tagss;\r
-// for (int i=1; i<files.size(); i++) {\r
-// tagss = files.get(i).getTags();\r
-// if (tagsList.size() != tagss.size() || !tagsList.containsAll(tagss)) {\r
-// tagsList = null;\r
-// break;\r
-// }\r
-// }\r
-// // Get the tags.\r
-// StringBuffer tagsBuffer = new StringBuffer();\r
-// if (tagsList==null)\r
-// tagsBuffer.append(MULTIPLE_VALUES_TEXT);\r
-// else {\r
-// Iterator i = tagsList.iterator();\r
-// while (i.hasNext()) {\r
-// String tag = (String) i.next();\r
-// tagsBuffer.append(tag).append(", ");\r
-// }\r
-// if (tagsBuffer.length() > 1)\r
-// tagsBuffer.delete(tagsBuffer.length() - 2, tagsBuffer.length() - 1);\r
-// }\r
-// initialTagText = tagsBuffer.toString();\r
-// tags.setText(initialTagText);\r
-// tags.addFocusHandler(new FocusHandler() {\r
-// @Override\r
-// public void onFocus(FocusEvent event) {\r
-// if (MULTIPLE_VALUES_TEXT.equals(tags.getText()))\r
-// tags.setText("");\r
-// }\r
-// }\r
-// );\r
-//\r
-// generalTable.setWidget(2, 1, tags);\r
generalTable.getFlexCellFormatter().setStyleName(0, 0, "props-labels");\r
generalTable.getFlexCellFormatter().setColSpan(0, 0, 2);\r
generalTable.getFlexCellFormatter().setStyleName(1, 0, "props-labels");\r
\r
generalPanel.add(generalTable);\r
\r
- // Asynchronously retrieve the tags defined by this user.\r
-// DeferredCommand.addCommand(new Command() {\r
-//\r
-// @Override\r
-// public void execute() {\r
-// updateTags();\r
-// }\r
-// });\r
-\r
DisclosurePanel allTags = new DisclosurePanel("All tags");\r
allTagsContent = new FlowPanel();\r
allTags.setContent(allTagsContent);\r
*/\r
@Override\r
protected void accept() {\r
-// JSONObject json = new JSONObject();\r
-// if ( versionedCheck.getState()!=null && !versionedCheck.getState().equals(initialVersioned) )\r
-// json.put("versioned", JSONBoolean.getInstance(versionedCheck.getState()));\r
-//\r
-// JSONArray taga = new JSONArray();\r
-// int i = 0;\r
-// String tagText = tags.getText();\r
-// if (!MULTIPLE_VALUES_TEXT.equals(tagText) && !initialTagText.equals(tagText)) {\r
-// String[] tagset = tagText.split(",");\r
-// for (String t : tagset) {\r
-// JSONString to = new JSONString(t);\r
-// taga.set(i, to);\r
-// i++;\r
-// }\r
-// json.put("tags", taga);\r
-// }\r
-// String jsonString = json.toString();\r
-// if(jsonString.equals("{}")){\r
-// GWT.log("NO CHANGES", null);\r
-// return;\r
-// }\r
-// final List<String> fileIds = new ArrayList<String>();\r
-// for(FileResource f : files)\r
-// fileIds.add(f.getUri()+"?update=");\r
-// MultiplePostCommand rt = new MultiplePostCommand(fileIds.toArray(new String[0]), jsonString, 200){\r
-//\r
-// @Override\r
-// public void onComplete() {\r
-// Pithos.get().getTreeView().refreshCurrentNode(false);\r
-// }\r
-//\r
-// @Override\r
-// public void onError(String p, Throwable t) {\r
-// GWT.log("", t);\r
-// if(t instanceof RestException){\r
-// int statusCode = ((RestException)t).getHttpStatusCode();\r
-// if(statusCode == 405)\r
-// Pithos.get().displayError("You don't have the necessary permissions");\r
-// else if(statusCode == 404)\r
-// Pithos.get().displayError("File does not exist");\r
-// else if(statusCode == 409)\r
-// Pithos.get().displayError("A file with the same name already exists");\r
-// else if(statusCode == 413)\r
-// Pithos.get().displayError("Your quota has been exceeded");\r
-// else\r
-// Pithos.get().displayError("Unable to modify file::"+((RestException)t).getHttpStatusText());\r
-// }\r
-// else\r
-// Pithos.get().displayError("System error modifying file:"+t.getMessage());\r
-// }\r
-// };\r
-// DeferredCommand.addCommand(rt);\r
}\r
}\r