Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Vity
    @Vity01
    it requires layout...
    ntoskrnl11
    @ntoskrnl11
    I thought swing has some default layout on components where you don't put a layout?
    Vity
    @Vity01
    it should , but it obviously is not expected
    java.lang.NullPointerException
    at org.jdesktop.swingx.JXTitledSeparator.getComponentOrientation(JXTitledSeparator.java:344)
    at com.alee.utils.SwingUtils.setOrientation(SwingUtils.java:604)
    at com.alee.utils.SwingUtils.setOrientation(SwingUtils.java:592)
    it's probably too incompatible
    the search btn is a bit hack
    this second problem is inside SwingX... I won't able to fix it
    ntoskrnl11
    @ntoskrnl11
    Hmm
    Vity
    @Vity01
    They are calling this in constructor:
       setLayout(new GridBagLayout());
    
        label = new JLabel(title) {
            @Override
            public void updateUI(){
              super.updateUI();
              updateTitle();
            }
        };
    I suspect setLayout calls the LaF, but label is not set yet...
    btw. have you played with J8 lambdas?
    ntoskrnl11
    @ntoskrnl11
    A little, but I haven't programmed much with them
    Vity
    @Vity01
    I will find a book for you if you want
    Screenshot 2017-07-09 12.32.02.png
    Screenshot 2017-07-09 12.33.10.png
    A bit ugly I guess
    btw. I solved it with
    ```   final ComponentOrientation componentOrientation = new JLabel().getComponentOrientation();
    ```          titleSeparator = new JXTitledSeparator("") {
    ```            @Override
    ```            public ComponentOrientation getComponentOrientation() {
    ```                return componentOrientation;
    ```            }
    ```        };
    Vity
    @Vity01
    the formatting here is a piece of crap
    time for lunch
    let me know , if you will need something
    Vity
    @Vity01
    I got a response from jtattoo guy, he will fix it asap
    ntoskrnl11
    @ntoskrnl11
    Ok
    high recommendations
    ntoskrnl11
    @ntoskrnl11
    Ok, maybe I'll take a look
    tong2shot
    @tong2shot
    Hi
    Java8 has much more interesting features than Java7: lambda, streams, etc. But winXP is not supported unfortunatelly.
    This is weekend, what are we doing here :smile:
    Vity
    @Vity01
    :-)
    this is the last free weekend I have without GF
    she will come back from Macedonia tommorow
    @ntoskrnl11 eg. this code:
                    final ArrayListModel<DownloadFile> files = dataManager.getDownloadFiles();
                    int counterFound = 0;
                    for (DownloadFile file : files) {
                        final URL urlAddress = file.getFileUrl();
                        if (urlList.contains(urlAddress))
                            ++counterFound;
                    }
                    if (counterFound == urlList.size())
                        return;
    can be converted into:
                    int counterFound = dataManager.getDownloadFiles().stream().filter(item -> urlList.contains(item.getFileUrl())).count();
                    if (counterFound == urlList.size())
                        return;
    Vity
    @Vity01
    or this one:
                    SwingUtilities.invokeLater(new Runnable() {
                        public void run() {
                            updateButtons(Boolean.valueOf(evt.getNewValue()));
                        }
                    });
                    SwingUtilities.invokeLater(() -> updateButtons(Boolean.valueOf(evt.getNewValue())));
    Vity
    @Vity01
    this is funny
    /**
     * Returns the common elements in two Lists.
     *
     * @param list1 List 1
     * @param list2 List 2
     * @return List containing the elements which exist in both lists passed as arguments.
     */
    private static List<URL> getCommonElements(final List<URL> list1, final List<URL> list2) {
        final Map<String, URL> map = new HashMap<String, URL>(list1.size());
        final List<URL> commonElements = new ArrayList<URL>();
        for (final URL u : list1) {
            map.put(u.toString(), u);
        }
        for (final URL u : list2) {
            if (map.containsKey(u.toString())) {
                commonElements.add(u);
            }
        }
        return commonElements;
    }
    I guess it can be replaced with list1.retainAll(list2)
    but maybe not, because of URL equals, right?
    ntoskrnl11
    @ntoskrnl11
    Yep
    Vity
    @Vity01
    hmms, I will clean the class and move it to some utils
    sadly we don't use some our implementation of URL...
    tong2shot
    @tong2shot
    @ntoskrnl11 I think you forgot to modify plugin repo /devapp/ for DevDialogSupport and DevStorageSupport classes. (To implement the interfaces changes).
    ntoskrnl11
    @ntoskrnl11
    @tong2shot Yeah I didn't update the plugin repo with the changes yet
    tong2shot
    @tong2shot
    Although it's easy to fix the jackson issue (we upgrade from 1.8 to 2.x) for plugins. I think it's better to also ship the 1.8 version of jackson lib, they can be used side-by-side.Hard breakage, and forcing to upgrade most likely will annoy users.
    BTW we use jackson lib in over two dozens plugins: YouTube, Vimeo, UlozTo, CeskaTV, TwitchTV, AppleTrailers, Flickr, etc.
    tong2shot
    @tong2shot
    Another BTW, there's httpclient lib in Java9, which supports http/2, currently it's in incubator state. The proper release is probably in Java10. Also apache httpclient v5.x is on the horizon, currently it's in alpha stage.