Permalink
Browse files

- issue70: save to file dialog does not select files properly on osx

- issue49: cannot easily scroll the job bar and goes to beginning when closing job
- issue62: ability to update a specific field directly by right clicking
- issue67: unlock icon turns back to lock after clicking on db's collection
- issue73: by default no automatic tree updating, cause it can be slow in some situation
- issue57: gridfs download file throws exception that file is directory
- issue52: add "reset to default" button for all forms
- issue71: Allow copy field value from results
  • Loading branch information...
1 parent 9bcd771 commit 4fadcb634f5a1691825a816b4970054a064d1da5 @agirbal committed May 31, 2012
View
Binary file not shown.
View
Binary file not shown.
View
@@ -573,6 +573,13 @@ is divided into following sections:
<propertyfile file="${built-jar.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
+ <antcall target="-maybe-call-dep">
+ <param name="call.built.properties" value="${built-jar.properties}"/>
+ <param location="${project.SwingFast}" name="call.subproject"/>
+ <param location="${project.SwingFast}/build.xml" name="call.script"/>
+ <param name="call.target" value="jar"/>
+ <param name="transfer.built-jar.properties" value="${built-jar.properties}"/>
+ </antcall>
</target>
<target depends="init,-check-automatic-build,-clean-after-automatic-build" name="-verify-automatic-build"/>
<target depends="init" name="-check-automatic-build">
@@ -1022,6 +1029,13 @@ is divided into following sections:
<propertyfile file="${built-clean.properties}">
<entry key="${basedir}" value=""/>
</propertyfile>
+ <antcall target="-maybe-call-dep">
+ <param name="call.built.properties" value="${built-clean.properties}"/>
+ <param location="${project.SwingFast}" name="call.subproject"/>
+ <param location="${project.SwingFast}/build.xml" name="call.script"/>
+ <param name="call.target" value="clean"/>
+ <param name="transfer.built-clean.properties" value="${built-clean.properties}"/>
+ </antcall>
</target>
<target depends="init" name="-do-clean">
<delete dir="${build.dir}"/>
@@ -1,8 +1,8 @@
-build.xml.data.CRC32=64f26677
+build.xml.data.CRC32=0d6a653a
build.xml.script.CRC32=9d7f4f72
build.xml.stylesheet.CRC32=28e38971@1.50.1.46
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
-nbproject/build-impl.xml.data.CRC32=64f26677
-nbproject/build-impl.xml.script.CRC32=3b6ca0b4
+nbproject/build-impl.xml.data.CRC32=0d6a653a
+nbproject/build-impl.xml.script.CRC32=09b2de18
nbproject/build-impl.xml.stylesheet.CRC32=fcddb364@1.50.1.46
@@ -28,14 +28,13 @@ dist.javadoc.dir=${dist.dir}/javadoc
endorsed.classpath=
excludes=
file.reference.mongo.jar=lib/mongo.jar
-file.reference.SwingFast.jar=lib/SwingFast.jar
file.reference.trunk-resource=resource
file.reference.trunk-src=src
includes=**
jar.compress=false
javac.classpath=\
${file.reference.mongo.jar}:\
- ${file.reference.SwingFast.jar}
+ ${reference.SwingFast.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false
@@ -66,6 +65,8 @@ manifest.file=manifest.mf
meta.inf.dir=${src.dir}/META-INF
mkdist.disabled=false
platform.active=default_platform
+project.SwingFast=../SwingFast/trunk
+reference.SwingFast.jar=${project.SwingFast}/dist/SwingFast.jar
resource.dir=${file.reference.trunk-resource}
run.classpath=\
${javac.classpath}:\
View
@@ -10,6 +10,15 @@
</source-roots>
<test-roots/>
</data>
- <references xmlns="http://www.netbeans.org/ns/ant-project-references/2"/>
+ <references xmlns="http://www.netbeans.org/ns/ant-project-references/2">
+ <reference>
+ <foreign-project>SwingFast</foreign-project>
+ <artifact-type>jar</artifact-type>
+ <script>${project.SwingFast}/build.xml</script>
+ <target>jar</target>
+ <clean-target>clean</clean-target>
+ <id>jar</id>
+ </reference>
+ </references>
</configuration>
</project>
@@ -1,2 +1,2 @@
handlers=java.util.logging.ConsoleHandler
-.level=INFO
+.level=FINE
View
@@ -23,6 +23,7 @@ function package_build {
cp ../dist/JMongoBrowser.jar $app/Contents/Resources/Java/
cp ../lib/*.jar $app/Contents/Resources/Java/
+ cp ./common-files/* $app/Contents/Resources/Java/
zip -r ${appdir}.zip $appdir
}
View
@@ -1 +1 @@
-1.1.2
+1.2.0
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -12,6 +12,25 @@
<IconGroup id="icons" folder="img" resource="true"/>
<IconGroup id="etIcons" folder="com/edgytech/swingfast/img" resource="true"/>
<com.edgytech.jmongobrowser.GlobalStore id="globalStore">
+ <com.edgytech.jmongobrowser.DocumentMenu id="documentMenu">
+ <MenuItem id="update" call="update" showDialog="false">
+ <FormDialog>
+ <com.edgytech.jmongobrowser.DocBuilderField id="upUpdate" label="Update" toolTipText="Update to apply to document, in JSON format"/>
+ </FormDialog>
+ </MenuItem>
+ <MenuItem id="remove" call="remove">
+ <ConfirmDialog text="Are you sure you want to remove this document?"/>
+ </MenuItem>
+ <MenuSeparator/>
+ <MenuItem id="copyValue" call="copyValue"/>
+ </com.edgytech.jmongobrowser.DocumentMenu>
+ <com.edgytech.jmongobrowser.DocumentFieldMenu id="documentFieldMenu">
+ <MenuItem id="set" call="set"/>
+ <MenuItem id="unset" call="unset"/>
+ <MenuSeparator/>
+ <MenuItem id="copyField" call="copyField"/>
+ <MenuItem id="copyValue" call="copyValue"/>
+ </com.edgytech.jmongobrowser.DocumentFieldMenu>
<com.edgytech.jmongobrowser.OptionDialog id="optionDialog">
<TabbedDiv>
<Div id="queryOption">
@@ -48,17 +67,17 @@
<IntSpinner id="autoCount" label="Count" minValue="0" value="100" toolTipText="Number of times to update, 0 means forever"/>
</com.edgytech.jmongobrowser.AutoUpdateDialog>
<com.edgytech.jmongobrowser.ExportDialog id="exportDialog">
- <FileChooserField id="outputFile">
- <FileChooserDialog type="SAVE" mode="FILES_ONLY"/>
- </FileChooserField>
+ <FileSelectorField id="outputFile">
+ <FileSelectorDialog type="SAVE" mode="FILES_ONLY"/>
+ </FileSelectorField>
<ComboBox id="format" items="JSON;JSON Array;CSV;BSON" toolTipText="Format to use for the export"/>
<TextField id="fields" toolTipText="Comma-separated list of fields to export, mandatory for CSV format"/>
<CheckBox id="continueOnError" toolTipText="Continue after an error occurs"/>
</com.edgytech.jmongobrowser.ExportDialog>
<com.edgytech.jmongobrowser.ImportDialog id="importDialog">
- <FileChooserField id="inputFile">
- <FileChooserDialog type="OPEN" mode="FILES_ONLY"/>
- </FileChooserField>
+ <FileSelectorField id="inputFile">
+ <FileSelectorDialog type="OPEN" mode="FILES_ONLY"/>
+ </FileSelectorField>
<ComboBox id="format" items="JSON;JSON Array;CSV;BSON" toolTipText="Format to use for the export"/>
<CheckBox id="continueOnError" toolTipText="Continue after an error occurs"/>
<CheckBox id="dropCollection" toolTipText="Drop collection before import"/>
@@ -210,9 +229,9 @@
<Menu id="GridFS" label="GridFS">
<MenuItem id="uploadFile" call="uploadFile">
<FormDialog id="uploadFileDialog">
- <FileChooserField id="uploadFilePath" label="Local File">
- <FileChooserDialog type="OPEN" selectionMode="FILES_ONLY"/>
- </FileChooserField>
+ <FileSelectorField id="uploadFilePath" label="Local File">
+ <FileSelectorDialog type="OPEN" selectionMode="FILES_ONLY"/>
+ </FileSelectorField>
<TextField id="uploadFileName" label="File Name" toolTipText="Optional, Name of the file as stored on the server"/>
<TextField id="uploadContentType" toolTipText="Optional, Content type to associate with file"/>
<com.edgytech.jmongobrowser.DocBuilderField id="uploadMetadata" label="Metadata" toolTipText="Optional, JSON object representing the file's metadata"/>
@@ -223,9 +242,9 @@
<Text value="Specify a query object or a file name"/>
<com.edgytech.jmongobrowser.DocBuilderField id="downloadQuery" label="Query" toolTipText="Find the file using this query"/>
<TextField id="downloadFileName" label="File Name" toolTipText="Name of the file as stored on the server"/>
- <FileChooserField id="downloadFilePath" label="Save As">
- <FileChooserDialog type="SAVE" selectionMode="FILES_ONLY"/>
- </FileChooserField>
+ <FileSelectorField id="downloadFilePath" label="Save As">
+ <FileSelectorDialog type="SAVE" selectionMode="FILES_ONLY"/>
+ </FileSelectorField>
</FormDialog>
</MenuItem>
<MenuItem id="deleteFile" call="deleteFile">
@@ -312,7 +331,7 @@
</FormDialog>
</MenuItem>
<MenuItem id="mapReduce" call="mapReduce">
- <FormDialog buttons="OK_CANCEL_RESET">
+ <FormDialog>
<TextArea id="mrMap" label="Map JS Function" toolTipText="map javascript function with signature 'void function map()' which should contain one or more calls to emit(key, obj)" nonEmpty="true" value="function(){ emit(this._id, {count: 1}); }"/>
<TextArea id="mrReduce" label="Reduce JS Function" toolTipText="reduce javascript function with signature 'result reduce(key, values)' where key is the emit key and values is the list of values to reduce.'" nonEmpty="true" value="function(key, values) { total = 0; for (var i = 0; i &lt; values.length; ++i) { total += values[i].count; }; return {count: total}; }"/>
<TextArea id="mrFinalize" label="Finalize JS Function" toolTipText="optional finalize javascript function with signature 'result finalize(key, out)' where out is the result for that key"/>
@@ -737,12 +756,12 @@
<MenuItem id="importFile" alt="i" call="importFile"/>
<MenuSeparator/>
<MenuItem id="preferences" alt="p" key="comma" keyMod="cmd">
- <com.edgytech.jmongobrowser.AppPreferences id="prefDialog" start="start" buttons="OK_CANCEL_RESET">
+ <com.edgytech.jmongobrowser.AppPreferences id="prefDialog" start="start">
<TabbedDiv id="optionTabs">
<Div id="general" gap="true">
<Div id="view" gap="true" titled="true">
- <IntSpinner id="treeUpdateRate" minValue="0" step="1000" value="10000" toolTipText="Rate in ms at which to update the Tree information (server down, master, etc). 0 means no automatic updating."/>
- <IntSpinner id="inlineDocumentLength" minValue="1" value="100" toolTipText="Number of characters to display for the document inline preview"/>
+ <IntSpinner id="treeUpdateRate" minValue="0" step="1000" value="0" toolTipText="Rate in ms at which to update the Tree information (server down, master, etc). 0 means no automatic updating."/>
+ <IntSpinner id="inlineDocumentLength" minValue="1" value="200" toolTipText="Number of characters to display for the document inline preview"/>
</Div>
<Div id="querying" gap="true" titled="true">
<IntSpinner id="getMoreSize" minValue="1" value="50" toolTipText="Number of documents to fetch when getting more results from a cursor"/>
View
@@ -15,10 +15,6 @@
<Text label=" "/>
<Button id="tabClose" icon="dialog-close_16.png" iconGroup="icons" call="close" fixedSize="20;20"/>
</Div>
- <PopUpMenu id="popUp">
- <MenuItem id="popUpdate" label="Update" call="update"/>
- <MenuItem id="popRemove" label="Remove" call="remove"/>
- </PopUpMenu>
</XmlUnit>
<MenuBar zone="NORTH" id="menuBar">
<Text id="icon" icon="page_table.png" iconGroup="icons" toolTipText="Index"/>
@@ -33,17 +29,6 @@
<MenuItem id="expandAll" call="expandAll"/>
<MenuItem id="collapseAll" call="collapseAll"/>
</Menu>
- <Menu id="document" enabled="false">
- <MenuItem id="update" call="update" showDialog="false">
- <FormDialog>
- <com.edgytech.jmongobrowser.DocBuilderField id="upUpdate" label="Update" toolTipText="Update to apply to document, in JSON format"/>
- <CheckBox id="upMulti" label="Multi" toolTipText="Update all matched documents"/>
- </FormDialog>
- </MenuItem>
- <MenuItem id="remove" call="remove">
- <ConfirmDialog text="Remove document?"/>
- </MenuItem>
- </Menu>
<Menu id="tools">
<MenuItem id="startAutoUpdate" call="startAutoUpdate" enabled="false"/>
<MenuItem id="stopAutoUpdate" call="stopAutoUpdate" enabled="false"/>
@@ -1,42 +0,0 @@
-/*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
-
-package com.edgytech.jmongobrowser;
-
-import com.mongodb.BasicDBObject;
-import com.mongodb.DBObject;
-
-/**
- *
- * @author antoine
- */
-public class DBObjectWrapper {
- Object key;
- DBObject obj;
-
- public DBObjectWrapper(Object key, DBObject obj) {
- this.key = key;
- this.obj = obj;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- if (key != null)
- sb.append(key).append(": ");
- sb.append(MongoUtils.dbObjectToString(obj));
- return sb.toString();
- }
-
- public Object getKey() {
- return key;
- }
-
- public DBObject getDBObject() {
- return obj;
- }
-
-
-}
@@ -5,6 +5,7 @@
package com.edgytech.jmongobrowser;
import com.edgytech.swingfast.SwingFast;
+import com.mongodb.BasicDBObject;
import com.mongodb.CommandResult;
import com.mongodb.DB;
import com.mongodb.DBCollection;
@@ -56,7 +57,7 @@ protected void updateNode(List<ImageIcon> overlays) {
label = db.getName();
// db.getStats is too slow.. just do a quick command
// CommandResult res = db.getStats();
- CommandResult res = db.command("getLastError");
+ CommandResult res = db.command(new BasicDBObject("profile", -1));
res.throwOnError();
// label += " (" + res.getInt("objects") + "/" + res.getInt("dataSize") + ")";
@@ -58,7 +58,7 @@ public void setDoc(DBObject doc) {
return;
}
- value = MongoUtils.dbObjectToString(doc);
+ value = MongoUtils.getObjectString(doc);
}
public DBObject getDoc() {
@@ -73,46 +73,8 @@ public DocFieldText(String id, String key, Object value, DocFieldObject object)
}
public void edit() {
- Class ceditor = null;
- if (value == null) {
- ceditor = null;
- } else if (value instanceof String) {
- ceditor = EditStringDialog.class;
- } else if (value instanceof Binary) {
- ceditor = EditBinaryDialog.class;
- } else if (value instanceof ObjectId || value instanceof DBRefBase) {
- ceditor = EditObjectIdDialog.class;
- } else if (value instanceof Boolean) {
- ceditor = EditBooleanDialog.class;
- } else if (value instanceof Code || value instanceof CodeWScope) {
- ceditor = EditCodeDialog.class;
- } else if (value instanceof Date) {
- ceditor = EditDateDialog.class;
- } else if (value instanceof Double || value instanceof Float) {
- ceditor = EditDoubleDialog.class;
- } else if (value instanceof Long || value instanceof Integer) {
- ceditor = EditLongDialog.class;
- } else if (value instanceof Pattern) {
- ceditor = EditPatternDialog.class;
- } else if (value instanceof BSONTimestamp) {
- ceditor = EditTimestampDialog.class;
- } else if (value instanceof UUID) {
- ceditor = EditUuidDialog.class;
- }
-
- if (ceditor == null)
- return;
- EditFieldDialog editor = (EditFieldDialog) JMongoBrowser.instance.getGlobalStore().getFirstChildOfClass(ceditor, null);
- editor.setKey(key);
- editor.setValue(value);
-
- if (!editor.show()) {
- return;
- }
- value = editor.getValue();
+ value = JMongoBrowser.instance.getGlobalStore().editValue(key, value);
setStringFieldValue(Item.value, JSON.serialize(value));
- System.out.println(value.toString());
- System.out.println(JSON.serialize(value));
updateComponent();
_object.commitComponent();
}
Oops, something went wrong.

0 comments on commit 4fadcb6

Please sign in to comment.