Package org.locationtech.udig.bookmarks

Examples of org.locationtech.udig.bookmarks.IBookmarkService


        Label label = new Label(page, SWT.LEFT);
        //label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false));
        label.setText("Bookmarks ");
        label.pack();
       
        IBookmarkService bookmarkService = BookmarksPlugin.getBookmarkService();
        listenService(true);
       
        comboViewer = new ComboViewer(page, SWT.READ_ONLY);
        comboViewer.setContentProvider(new ArrayContentProvider());
        comboViewer.setLabelProvider(new LabelProvider(){
            @Override
            public String getText( Object element ) {
                if (element instanceof IBookmark) {
                    IBookmark bookmark = (IBookmark) element;
                    return bookmark.getName();
                }
                return super.getText(element);
            }
        });
        List<IBookmark> bookmarks = (List<IBookmark>)bookmarkService.getBookmarks();
        comboViewer.setInput(bookmarks);
       
        comboViewer.addSelectionChangedListener(comboListener);
       
        if (strategy != null ){
View Full Code Here


        }
        return null;
    }

    protected void listenService( boolean listen ){
        IBookmarkService bookmarkService = BookmarksPlugin.getBookmarkService();
        if (listen) {
            bookmarkService.addListener(serviceWatcher);
        } else {
            bookmarkService.removeListener(serviceWatcher);
        }
    }
View Full Code Here

    @Override
    public String getText( Object obj ) {
        String name;
        if (obj instanceof IBookmarkService) {
            IBookmarkService bManager = (BookmarkServiceImpl) obj;
            name = bManager.getName();
        } else if (obj instanceof Bookmark) {
            IBookmark bookmark = (IBookmark) obj;
            name = bookmark.getName();
        } else if (obj instanceof ProjectWrapper) {
            ProjectWrapper project = (ProjectWrapper) obj;
View Full Code Here

TOP

Related Classes of org.locationtech.udig.bookmarks.IBookmarkService

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.