Changeset 1682 in josm


Ignore:
Timestamp:
2009-06-20T09:31:00+02:00 (11 years ago)
Author:
Gubaer
Message:

removed old conflict resolution code
fixed bug in OsmApi (missing changeset initialization)

Location:
trunk
Files:
3 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/.settings/org.eclipse.jdt.ui.prefs

    r1650 r1682  
    1 #Sat Jun 06 11:00:10 CEST 2009
     1#Mon Jun 08 20:01:40 CEST 2009
     2cleanup_settings_version=2
    23eclipse.preferences.version=1
     4editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
    35formatter_profile=_josm
    46formatter_settings_version=11
    57org.eclipse.jdt.ui.javadoc=false
    68org.eclipse.jdt.ui.text.custom_code_templates=<?xml version\="1.0" encoding\="UTF-8" standalone\="no"?><templates><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter method" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="false" context\="filecomment_context" deleted\="false" description\="Comment for created Java files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.filecomment" name\="filecomment">// License\: GPL. \r\n</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for fields" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Javadoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate methods" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="false" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.newtype" name\="newtype">// License\: GPL. For details, see LICENSE file.\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="interfacebody_context" deleted\="false" description\="Code in new interface type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.interfacebody" name\="interfacebody">\r\n</template><template autoinsert\="true" context\="enumbody_context" deleted\="false" description\="Code in new enum type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.enumbody" name\="enumbody">\r\n</template><template autoinsert\="true" context\="annotationbody_context" deleted\="false" description\="Code in new annotation type bodies" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.annotationbody" name\="annotationbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created method stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated method stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.jdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template><template autoinsert\="true" context\="gettercomment_context" deleted\="false" description\="Comment for getter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.gettercomment" name\="gettercomment">/**\r\n * @return the ${bare_field_name}\r\n */</template><template autoinsert\="true" context\="settercomment_context" deleted\="false" description\="Comment for setter function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.settercomment" name\="settercomment">/**\r\n * @param ${param} the ${bare_field_name} to set\r\n */</template><template autoinsert\="true" context\="constructorcomment_context" deleted\="false" description\="Comment for created constructors" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorcomment" name\="constructorcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="filecomment_context" deleted\="false" description\="Comment for created JavaScript files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.filecomment" name\="filecomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="typecomment_context" deleted\="false" description\="Comment for created types" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.typecomment" name\="typecomment">/**\r\n * @author ${user}\r\n *\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="fieldcomment_context" deleted\="false" description\="Comment for vars" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.fieldcomment" name\="fieldcomment">/**\r\n * \r\n */</template><template autoinsert\="true" context\="methodcomment_context" deleted\="false" description\="Comment for non-overriding function" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodcomment" name\="methodcomment">/**\r\n * ${tags}\r\n */</template><template autoinsert\="true" context\="overridecomment_context" deleted\="false" description\="Comment for overriding functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.overridecomment" name\="overridecomment">/* (non-Jsdoc)\r\n * ${see_to_overridden}\r\n */</template><template autoinsert\="true" context\="delegatecomment_context" deleted\="false" description\="Comment for delegate functions" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.delegatecomment" name\="delegatecomment">/**\r\n * ${tags}\r\n * ${see_to_target}\r\n */</template><template autoinsert\="true" context\="newtype_context" deleted\="false" description\="Newly created files" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.newtype" name\="newtype">${filecomment}\r\n${package_declaration}\r\n\r\n${typecomment}\r\n${type_declaration}</template><template autoinsert\="true" context\="classbody_context" deleted\="false" description\="Code in new class type bodies" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.classbody" name\="classbody">\r\n</template><template autoinsert\="true" context\="catchblock_context" deleted\="false" description\="Code in new catch blocks" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.catchblock" name\="catchblock">// ${todo} Auto-generated catch block\r\n${exception_var}.printStackTrace();</template><template autoinsert\="true" context\="methodbody_context" deleted\="false" description\="Code in created function stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.methodbody" name\="methodbody">// ${todo} Auto-generated function stub\r\n${body_statement}</template><template autoinsert\="true" context\="constructorbody_context" deleted\="false" description\="Code in created constructor stubs" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.constructorbody" name\="constructorbody">${body_statement}\r\n// ${todo} Auto-generated constructor stub</template><template autoinsert\="true" context\="getterbody_context" deleted\="false" description\="Code in created getters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.getterbody" name\="getterbody">return ${field};</template><template autoinsert\="true" context\="setterbody_context" deleted\="false" description\="Code in created setters" enabled\="true" id\="org.eclipse.wst.jsdt.ui.text.codetemplates.setterbody" name\="setterbody">${field} \= ${param};</template></templates>
     9sp_cleanup.add_default_serial_version_id=true
     10sp_cleanup.add_generated_serial_version_id=false
     11sp_cleanup.add_missing_annotations=true
     12sp_cleanup.add_missing_deprecated_annotations=true
     13sp_cleanup.add_missing_methods=false
     14sp_cleanup.add_missing_nls_tags=false
     15sp_cleanup.add_missing_override_annotations=true
     16sp_cleanup.add_serial_version_id=false
     17sp_cleanup.always_use_blocks=false
     18sp_cleanup.always_use_parentheses_in_expressions=false
     19sp_cleanup.always_use_this_for_non_static_field_access=false
     20sp_cleanup.always_use_this_for_non_static_method_access=false
     21sp_cleanup.convert_to_enhanced_for_loop=false
     22sp_cleanup.correct_indentation=true
     23sp_cleanup.format_source_code=false
     24sp_cleanup.format_source_code_changes_only=false
     25sp_cleanup.make_local_variable_final=false
     26sp_cleanup.make_parameters_final=false
     27sp_cleanup.make_private_fields_final=false
     28sp_cleanup.make_type_abstract_if_missing_method=false
     29sp_cleanup.make_variable_declarations_final=false
     30sp_cleanup.never_use_blocks=false
     31sp_cleanup.never_use_parentheses_in_expressions=true
     32sp_cleanup.on_save_use_additional_actions=true
     33sp_cleanup.organize_imports=false
     34sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
     35sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
     36sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
     37sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
     38sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
     39sp_cleanup.remove_private_constructors=true
     40sp_cleanup.remove_trailing_whitespaces=true
     41sp_cleanup.remove_trailing_whitespaces_all=true
     42sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
     43sp_cleanup.remove_unnecessary_casts=true
     44sp_cleanup.remove_unnecessary_nls_tags=false
     45sp_cleanup.remove_unused_imports=false
     46sp_cleanup.remove_unused_local_variables=false
     47sp_cleanup.remove_unused_private_fields=true
     48sp_cleanup.remove_unused_private_members=false
     49sp_cleanup.remove_unused_private_methods=true
     50sp_cleanup.remove_unused_private_types=true
     51sp_cleanup.sort_members=false
     52sp_cleanup.sort_members_all=false
     53sp_cleanup.use_blocks=true
     54sp_cleanup.use_blocks_only_for_return_and_throw=true
     55sp_cleanup.use_parentheses_in_expressions=false
     56sp_cleanup.use_this_for_non_static_field_access=false
     57sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
     58sp_cleanup.use_this_for_non_static_method_access=false
     59sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
  • trunk/build.xml

    r1660 r1682  
    7777        </target>
    7878
     79        <target name="dev-deploy" depends="dist">
     80                <copy  file="dist/josm-custom.jar" todir="C:\data\projekte\osm\tag-editor-plugin"/>
     81        </target>
     82
    7983</project>
  • trunk/src/org/openstreetmap/josm/actions/downloadtasks/DownloadOsmTaskList.java

    r1676 r1682  
    2121import org.openstreetmap.josm.data.osm.DataSet;
    2222import org.openstreetmap.josm.data.osm.OsmPrimitive;
    23 import org.openstreetmap.josm.data.osm.OsmPrimitiveType;
    2423import org.openstreetmap.josm.gui.download.DownloadDialog.DownloadTask;
    2524import org.openstreetmap.josm.gui.layer.Layer;
     
    136135                +  "There are {0} primitives in your local dataset which<br>"
    137136                + "might be deleted on the server. If you later try to delete or<br>"
    138                 + "update them on the server the server is likely to report a<br>"
     137                + "update them the server is likely to report a<br>"
    139138                + "conflict.<br>"
    140139                + "<br>"
     
    177176    }
    178177
    179 
    180178    public Set<Long> getDownloadedIds() {
    181179        HashSet<Long> ret = new HashSet<Long>();
  • trunk/src/org/openstreetmap/josm/gui/dialogs/ConflictDialog.java

    r1677 r1682  
    2929
    3030import org.openstreetmap.josm.Main;
    31 import org.openstreetmap.josm.command.ConflictResolveCommand;
    3231import org.openstreetmap.josm.data.SelectionChangedListener;
    3332import org.openstreetmap.josm.data.osm.DataSet;
     
    3938import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    4039import org.openstreetmap.josm.data.osm.visitor.Visitor;
    41 import org.openstreetmap.josm.gui.ConflictResolver;
    42 import org.openstreetmap.josm.gui.ExtendedDialog;
    4340import org.openstreetmap.josm.gui.NavigatableComponent;
    4441import org.openstreetmap.josm.gui.OsmPrimitivRenderer;
     
    109106
    110107    private final void resolve() {
    111         String method = Main.pref.get("conflict.resolution", "extended");
    112         method = method.trim().toLowerCase();
    113         if (method.equals("traditional")) {
    114             resolveTraditional();
    115         } else if (method.equals("extended")) {
    116             resolveExtended();
    117         } else {
    118             System.out.println(tr("WARNING: unexpected value for preference conflict.resolution, got " + method));
    119             resolveTraditional();
    120         }
    121     }
    122 
    123 
    124     private final void resolveExtended() {
    125108        if(model.size() == 1) {
    126109            displaylist.setSelectedIndex(0);
     
    139122        dialog.getConflictResolver().populate(my, their);
    140123        dialog.setVisible(true);
    141         Main.map.mapView.repaint();
    142     }
    143 
    144 
    145     private final void resolveTraditional() {
    146         if(model.size() == 1) {
    147             displaylist.setSelectedIndex(0);
    148         }
    149 
    150         if (displaylist.getSelectedIndex() == -1)
    151             return;
    152         Map<OsmPrimitive, OsmPrimitive> sel = new HashMap<OsmPrimitive, OsmPrimitive>();
    153         for (int i : displaylist.getSelectedIndices()) {
    154             OsmPrimitive s = (OsmPrimitive)model.get(i);
    155             sel.put(s, conflicts.get(s));
    156         }
    157         ConflictResolver resolver = new ConflictResolver(sel);
    158         int answer = new ExtendedDialog(Main.parent,
    159                 tr("Resolve Conflicts"),
    160                 resolver,
    161                 new String[] { tr("Solve Conflict"), tr("Cancel") },
    162                 new String[] { "dialogs/conflict.png", "cancel.png"}
    163         ).getValue();
    164 
    165         if (answer != 1)
    166             return;
    167         Main.main.undoRedo.add(new ConflictResolveCommand(resolver.conflicts, sel));
    168124        Main.map.mapView.repaint();
    169125    }
  • trunk/src/org/openstreetmap/josm/io/OsmApi.java

    r1677 r1682  
    307307     * @return list of processed primitives
    308308     * @throws OsmTransferException if something is wrong
    309      * @throws OsmTransferCancelledException  if the upload was cancelled by the user
    310309     */
    311310    public Collection<OsmPrimitive> uploadDiff(final Collection<OsmPrimitive> list) throws OsmTransferException {
  • trunk/src/org/openstreetmap/josm/io/OsmServerWriter.java

    r1677 r1682  
    8484        processed = new LinkedList<OsmPrimitive>();
    8585
    86         // initialize API. Abort upload in case of configuration or network
    87         // errors
    88         //
    89         try {
    90             api.initialize();
    91         } catch(Exception e) {
    92             throw new OsmApiInitializationException(e);
    93         }
     86        api.initialize();
    9487
    9588        Main.pleaseWaitDlg.progress.setMaximum(primitives.size());
     
    125118            // upload changes individually (90% of code is for the status display...)
    126119            //
     120            api.createChangeset(getChangesetComment());
    127121            NameVisitor v = new NameVisitor();
    128122            uploadStartTime = System.currentTimeMillis();
     
    139133                Main.pleaseWaitDlg.progress.setValue(progress+1);
    140134            }
     135            api.stopChangeset();
    141136        }
    142137    }
Note: See TracChangeset for help on using the changeset viewer.