Clearing Eclipse Markers Programmatically - eclipse-rcp

Is there a way to clear the eclipse markers in the Markers View programmatically?
I'm logging Markers in eclipse Markers View.Before adding new markers,I want to clear the already existing markers for the same project alone.

Another approach could be clearing the markers by project, instead of resource:
project.deleteMarkers("markerId", true, IProject.DEPTH_INFINITE);

Call IResource#deleteMarkers() on the relevant resource: http://help.eclipse.org/kepler/topic/org.eclipse.platform.doc.isv/reference/api/org/eclipse/core/resources/IResource.html#deleteMarkers(java.lang.String, boolean, int) .

Related

Leaflet custom map (prod. with MapTiler) not shown in version 0.7.3

My custom map which has been produced by using MapTiler 0-5 levels displays well
on leaflet 0.6.4 but is not shown on version 0.7.3. Sorry, but I'm really new in using leaflet and maps. I've googled and checked the documentation on leaflet.com but haven't got any clue of a solution. Please help.
This is a demo using 0.6.4 and html already prepared for 0.7.3.
Sorry folks, I've just found my solution after googling again with other search
criteria. So I've found thread #2776 from Jakoboud pointing me to a possible solution. This does the trick -> continuousWorld: true and my map shows up.
Here's another question: how can I keep this map centered in browser window if the shown map part is smaller in width/height than browser window? map.setMaxBounds() doesn't work, it's bouncing the small map endlessly.

How can I only display projects inside a treeviewer eclipse plugin?

I am making a tree viewer in Eclipse which would be used to pick a project and then I would find out the location of the project and zip it up.
I can currently display a tree which shows all the projects but it also allows you to expand the tree.
I am doing this in a wizard so I am unable to any dialogs.
I think I would need a filter but after using Google for a while I was unable to figure out how I could do this.
This is how I am currently making the viewer.
TreeViewer view = new TreeViewer(composite,new WorkbenchLabelProvider(),new BaseWorkbenchContentProvider());
view.setInput(ResourcesPlugin.getWorkspace().getRoot());
It's showing you exactly what that content provider is written to show.
The short answer is to setInput(ResourcesPlugin.getWorkspace().getRoot().getProjects()) and use the ArrayContentProvider with a ListViewer rather than the TableViewer.
The long answer is that the content provider you were using returns both the top level elements for the tree control using getElements() and any resource's children via getChildren(), and your case is not interested in the results of getChildren().
Projects are never nested so you only really need a TableViewer to show them. You can get the list of projects using:
IProject [] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
The same label provider will work.

How to programmatically access an Eclipse JDT tooltip icon

I'd like to use the icon "Quick Assist Available" (lightbulb) from Eclipse's JDT Icons.
However, I cannot find a way to access it.
The closest I've gotten was thanks at Ilya Shinkarenko's blog, where he uses ISharedImages to access many Eclipse logos. However, the lightbulb icon is not on his list and I can't find it's proper name anywhere (I'm not even sure if it's part of ISharedImages).
Do you know where I can get a hold of this icon within Eclipse and use it in my own tooltip?
Here is this in action using a Groovy script:
import org.eclipse.jdt.internal.ui.JavaPluginImages;
def image = JavaPluginImages.get(JavaPluginImages.IMG_OBJS_QUICK_ASSIST)
def newView = eclipse.views.create("a button with an image");
def button = newView.add_Button().setImage(image);
You are looking for org.eclipse.jdt.internal.ui.JavaPluginImages.IMG_OBJS_QUICK_ASSIST.
A code snippet like JavaPluginImages.get(JavaPluginImages.IMG_OBJS_QUICK_ASSIST) should do the trick. (JavaPluginImages is not API hence you will get a warning in your code, but you can just ignore that)

Leaflet Multipolygon custom popup

I have an OSM map and I'm using leafletjs.
I have created my custom popup for marker. It it works fine and correctly.
marker.bindPopup(strMsg,{className: 'myPopup'});
This code works perfectly.
Now, I want to create a the same popup, but clicking on Multilopygon. The data for the polygon comes from geoJSON. This is the code I wrote for this issue
var c_park = L.geoJson(data[i].geom, {
style: myStyle
});
c_park.bindPopup("strMsg",{className: 'myPopup'});
map.addLayer(c_park);
The problem is myPopup class is not working for the popup of multipolygon and as a result I get the native popup window. If I manually change the class in browser - it is ok.
I tried different methods. F.e. using function onEachFeature to init popups. But nothing works.
Does anybody knows what is the problem ?
Does anybody knows what is the problem ?
There is no problem. ClassName is supported for markers as an option of L.icon. (docs).
Polygon inherits the options of polyline and path, which do not include ClassName (docs).
The way I see it you have two possibilities:
fork leaflet and add the className option to polygon
make a subclass inheriting polygon taking className as an option by overloading bindPopup

How can i make custom map for showing user current location in iphone?

i want to show my current location on custom map.The custom map is of my locality....so,please help me how can i use custom map in place of google map???
The main problem with offline maps is not the "map" but all the stuff you need to build to georeference your map.
Think only at a map zoom.
There are many good open source libraries/SDK to manage offline maps.
--EDIT--
It seems that the free code I found was removed.
As soon as I will find a new available one I will update this comment