package mesfavoris.viewers;

import org.eclipse.swt.graphics.Image;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.PlatformUI;

import mesfavoris.bookmarktype.AbstractBookmarkLabelProvider;
import mesfavoris.model.Bookmark;
import mesfavoris.model.BookmarkFolder;

public class BookmarkFolderLabelProvider extends AbstractBookmarkLabelProvider {

	@Override
	public Image getImage(Object element) {
		String imageKey = ISharedImages.IMG_OBJ_FOLDER;
		return PlatformUI.getWorkbench().getSharedImages().getImage(imageKey);
	}
	
	@Override
	public boolean handlesBookmark(Bookmark bookmark) {
		return bookmark instanceof BookmarkFolder;
	}

}

@@ -45,26 +45,141 @@
 pse.
-swt.graphics.Image
+jface.viewers.StyledString;%0Aimport org.eclipse.swt.SWT;%0Aimport org.eclipse.swt.graphics.Image;%0Aimport org.eclipse.swt.widgets.Display
 ;%0Aim
@@ -248,16 +248,51 @@
 ormUI;%0A%0A
+import mesfavoris.BookmarksPlugin;%0A
 import m
@@ -345,16 +345,65 @@
 ovider;%0A
+import mesfavoris.internal.views.StylerProvider;%0A
 import m
@@ -472,89 +472,1541 @@
 er;%0A
-%0Apublic class BookmarkFolderLabelProvider extends AbstractBookmarkLabelProvider %7B
+import mesfavoris.remote.IRemoteBookmarksStore;%0Aimport mesfavoris.remote.IRemoteBookmarksStore.State;%0Aimport mesfavoris.remote.RemoteBookmarkFolder;%0Aimport mesfavoris.remote.RemoteBookmarksStoreManager;%0A%0Apublic class BookmarkFolderLabelProvider extends AbstractBookmarkLabelProvider %7B%0A%09private final RemoteBookmarksStoreManager remoteBookmarksStoreManager;%0A%09private final StylerProvider stylerProvider = new StylerProvider();%0A%0A%09public BookmarkFolderLabelProvider() %7B%0A%09%09this.remoteBookmarksStoreManager = BookmarksPlugin.getRemoteBookmarksStoreManager();%0A%09%7D%0A%0A%09@Override%0A%09public StyledString getStyledText(Object element) %7B%0A%09%09BookmarkFolder bookmarkFolder = (BookmarkFolder) element;%0A%09%09StyledString result = super.getStyledText(element);%0A%09%09RemoteBookmarkFolder remoteBookmarkFolder = remoteBookmarksStoreManager%0A%09%09%09%09.getRemoteBookmarkFolder(bookmarkFolder.getId());%0A%09%09if (remoteBookmarkFolder != null) %7B%0A%09%09%09IRemoteBookmarksStore remoteBookmarksStore = remoteBookmarksStoreManager%0A%09%09%09%09%09.getRemoteBookmarksStore(remoteBookmarkFolder.getRemoteBookmarkStoreId());%0A%09%09%09if (remoteBookmarksStore.getState() == State.connected && isReadOnly(remoteBookmarkFolder)) %7B%0A%09%09%09%09result.append(%22 %5Breadonly%5D%22, stylerProvider.getStyler(null,%0A%09%09%09%09%09%09Display.getCurrent().getSystemColor(SWT.COLOR_DARK_YELLOW), null));%0A%09%09%09%7D%0A%09%09%7D%0A%0A%09%09return result;%0A%09%7D%0A%0A%09private boolean isReadOnly(RemoteBookmarkFolder remoteBookmarkFolder) %7B%0A%09%09return Boolean.TRUE.toString()%0A%09%09%09%09.equalsIgnoreCase(remoteBookmarkFolder.getProperties().get(RemoteBookmarkFolder.PROP_READONLY));%0A%09%7D
 %0A%0A%09@
@@ -2181,17 +2181,16 @@
 ey);%0A%09%7D%0A
-%09
 %0A%09@Overr

Add [readonly] for readonly remote bookmark folders