Code Monkey home page Code Monkey logo

nb-sort-line-tools's Introduction

nb-sort-line-tools

NetBeans plugin which adds a toolbar with texteditor operations for sorting.

Screenshot

Features

  1. Sort lines spanned by selection in ascending/descending (in-)case-sensitive order.
  2. Remove duplicate lines while sorting.

You can also assign shortcuts to these actions.

Downloads

Further information

This plugin is based on the "Line Tools" plugin from sandipchitale @ (http://plugins.netbeans.org/plugin/3857/line-tools) It is mainly a repackaging to be compatible with NetBeans 7.x.

All obsolete features except sorting are disabled. No bugs were fixed or features added. Original sourcecode can be found at http://hg.netbeans.org/main/contrib/file/tip/linetools

Requirements

  • NetBeans 11.0 and higher

Note

  • Case sensitive and Remove Duplicate lines options don't work in NetBeans 11.0 and 11.1 because of the bug of NetBeans

License

License remains CDDL - http://www.netbeans.org/cddl-gplv2.html

nb-sort-line-tools's People

Contributors

junichi11 avatar markiewb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

nb-sort-line-tools's Issues

Unicode sorting

Would it be possible to sort some non-English words please?

I can't send any pull request but this should work into LineOperations.java:

import java.text.Collator;
import java.util.Locale;
// line 149
                        Comparator<String> comparator = null;
                        Collator collator = null;
                        if (descending) {
                            if (matchCase) {
                                comparator = REVERSE_STRING_COMPARATOR;
                            } else {
                                comparator = REVERSE_STRING_COMPARATOR_CASE_INSENSITIVE;
                            }
                        } else {
                            if (matchCase) {
                                Locale locale = new Locale("fr_FR");
                                collator = Collator.getInstance(locale);
                            } else {
                                comparator = String.CASE_INSENSITIVE_ORDER;
                            }
                        }

                        if (isRemoveDuplicateLines()) {
                            SortedSet<String> uniqifySet = new TreeSet<String>(matchCase ? null : String.CASE_INSENSITIVE_ORDER);
                            uniqifySet.addAll(Arrays.asList(linesText));
                            linesText = uniqifySet.toArray(new String[0]);
                        }

                        if (comparator == null) {
                            Arrays.sort(linesText, collator);
                        } else {
                            Arrays.sort(linesText, comparator);
                        }

The plug-in loading check cannot be completed. Reason: NBM

The plug-in loading check cannot be completed. Reason: NBM
C:\Users\koren\AppData\Roaming\NetBeans\14\update\download\org-netbeans-modules-linetools.nbm needs unpack200 to process following entries:
netbeans/modules/docs/org-netbeans-modules-linetools.jar.pack.gz
netbeans/modules/org-netbeans-modules-linetools.jar.pack.gz

Add plugin to portal

I like this plugin, but since netbeans was moved to apache, the plugin is not available through the "official" catalog. It would be great if this can be added:
Plugin-Portal

It is hard to believe such a feature is not integrated in that editor.

org-netbeans-modules-linetools.nbm needs unpack200

Hi,

Im using Netbeans IDE 12.2 and trying to install this plugin,
Can you please update it, so it will install on 12.2

Getting this error.

org-netbeans-modules-linetools.nbm needs unpack200 to process following entries:
netbeans/modules/docs/org-netbeans-modules-linetools.jar.pack.gz
netbeans/modules/org-netbeans-modules-linetools.jar.pack.gz

Sorting "case"

I know this plugin is designed to sort "lines".
But sometimes you have switch/case and for a better overview, the cases are better organized if sorted.
I don't know if this could/should be integrated, but it would be a nice enhancement.
The difference is, cases are followed by code:
case 'xxx':
code...
[break]
case 'yyy':
code...
[break]

I assume that is to complicated, but it would ease some day work :)

Remove warnings while building

  • warning: [deprecation] atomicLock() in BaseDocument has been deprecated
    ((BaseDocument)doc).atomicLock();
  • warning: had to upgrade dependencies for module org.netbeans.modules.linetools: added = [module org.openide.util.lookup > 8.0] removed = []; details: [#170056: Separate module for Lookup API]
    Warning: org.netbeans.modules.linetools lacks a unit test dependency on org.netbeans.libs.junit4; using default dependencies for compatibility

Put the actions in the context menu

It would be really cool to have that functionality in a context menu. So that you can do a right click when you selected a portion of text and then sort it.

installation error

I was download module (from https://github.com/netbeanslab/nb-sort-line-tools/releases/download/1.23/org-netbeans-modules-linetools-1.23.nbm) and tried to install it. But I has got the error:

Installation completed unsuccessfully
Click Finish to quit the NetBeans IDE installer and try to restart IDE.
The Plugin Installer found problem timeout of loading Sort Line 
Tools[org.netbeans.modules.linetools/1.23] while install the following plugins:
Sort Line Tools

version of my software:

Product Version: Apache NetBeans IDE 12.0
Java: 14.0.2; Java HotSpot(TM) 64-Bit Server VM 14.0.2+12-46
Runtime: Java(TM) SE Runtime Environment 14.0.2+12-46
System: Linux version 4.15.0-161-generic running on amd64; UTF-8; en_US (nb)
User directory: ~/.netbeans/12.0
Cache directory: ~/.cache/netbeans/12.0

version of my operation system:

Ubuntu 18.04.6 LTS
OS-type: 64-bit

Needs unpack200

Plugin doesn't install when NB is run on JDK 14+:

The validation of downloaded plugins cannot be completed, cause: NBM .../update/download/org-netbeans-modules-linetools.nbm needs unpack200 to process following entries: 
netbeans/modules/docs/org-netbeans-modules-linetools.jar.pack.gz
netbeans/modules/org-netbeans-modules-linetools.jar.pack.gz

I think it should be repackaged.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.