Package org.locationtech.udig.issues

Examples of org.locationtech.udig.issues.IssuesList


            IIssuesManager.defaultInstance.save(new NullProgressMonitor());
           
            assertTrue(view.forTestingGetRefreshButton().isEnabled());
            assertFalse(view.forTestingGetSaveButton().isEnabled());
           
            IIssuesManager.defaultInstance.setIssuesList(new IssuesList());
            assertFalse(view.forTestingGetRefreshButton().isEnabled());
            assertFalse(view.forTestingGetSaveButton().isEnabled());
        }finally{
            IIssuesManager.defaultInstance.setIssuesList(old);
        }
View Full Code Here


    }

    @Test
    public void testSetIssuesList() throws Exception {
        IssuesManager m = new IssuesManager();
        IIssuesList issuesList = new IssuesList();
        m.setIssuesList(issuesList);

        final AtomicBoolean addedListener = new AtomicBoolean(false);
        final AtomicBoolean removedListener = new AtomicBoolean(false);
        DummyIssue dummyIssue = new DummyIssue(3){
            @Override
            public void addIssueListener( IIssueListener listener ) {
                addedListener.set(true);
            }

            @Override
            public void removeIssueListener( IIssueListener listener ) {
                removedListener.set(true);
            }
        };
        issuesList.add(dummyIssue);
        assertTrue(addedListener.get());
        assertFalse(removedListener.get());

        addedListener.set(false);

        m.setIssuesList(new IssuesList());

        assertFalse(addedListener.get());
        assertTrue(removedListener.get());

        removedListener.set(false);
View Full Code Here

        assertNotNull(listEvent[0]);
        assertNull(managerEvent[0]);

        listEvent[0] = null;

        m.setIssuesList(new IssuesList());

        assertEquals(IssuesManagerEventType.ISSUES_LIST_CHANGE, managerEvent[0].getType());
        assertNull(listEvent[0]);

        managerEvent[0] = null;
View Full Code Here

    }

    @Test
    public void testSaveIssuesList() throws Exception {
        IssuesManager m = new IssuesManager();
        IIssuesList issuesList = new IssuesList();
        m.setIssuesList(issuesList);
        issuesList.add(IssuesListTestHelper.createFeatureIssue("1")); //$NON-NLS-1$

        // no exception happens, and nothing else.
        assertFalse(m.save(new NullProgressMonitor()));

        DataStore[] store = new DataStore[1];
        SimpleFeatureType[] featureType = new SimpleFeatureType[1];
        issuesList = IssuesListTestHelper.createInMemoryDatastoreIssuesList(store, featureType);
        m.setIssuesList(issuesList);

        FeatureIssue createIssue = IssuesListTestHelper.createFeatureIssue("2"); //$NON-NLS-1$
        issuesList.add(createIssue);
        issuesList.add(IssuesListTestHelper.createFeatureIssue("3")); //$NON-NLS-1$
        assertFalse(m.save(new NullProgressMonitor()));

        createIssue.setPriority(Priority.TRIVIAL);

        class Listener implements IIssuesListListener {

            private Collection< ? extends IIssue> saved;

            public void notifyChange( IssuesListEvent event ) {

                if (event.getType() == IssuesListEventType.SAVE)
                    saved = event.getChanged();
            }

        };

        Listener listener = new Listener();
        issuesList.addListener(listener);

        assertTrue(m.save(new NullProgressMonitor()));
        assertEquals(1, listener.saved.size());
        assertEquals(createIssue.getId(), listener.saved.iterator().next().getId());
    }
View Full Code Here

                }
            }
        }

        if (issuesList == null) {
            issuesList = new IssuesList();
        }
       
        if( issuesList instanceof IRemoteIssuesList ){
            try {
                ((IRemoteIssuesList)issuesList).refresh();
            } catch (IOException e) {
                IssuesActivator.log("failed to refresh issues list", e); //$NON-NLS-1$
                issuesList=new IssuesList();
            }
        }else if (issuesList instanceof IssuesList){
          ((IssuesList)issuesList).load();
        }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.issues.IssuesList

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.