Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » custom marker view in an RCP app using evl(how to catch validation markers in a custom marker view?)
custom marker view in an RCP app using evl [message #536711] Sun, 30 May 2010 08:45 Go to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi all,
I'm writing an RCP app based on EMF+GMF+EVL
and I'm successfully validating my model against the constraints I've written in the evl file.

Now I would like them to appear in the problems view, but it's not working: I've read that the problems view is not working with an RCP app.

So I'm trying to implement a custom marker view in order to catch such markers.

I've followed the instructions on http:// blog.eclipse-tips.com/2008/11/creating-custom-marker-view.ht ml
but can't get it work.

What's the type of markers generated by evl?
I thought it to be org.eclipse.emf.ecore.diagnostic.

In my plugin.xml of the diagram plugin used by my GMF app I've added the following code

<extension
      point="org.eclipse.ui.views">
   <view
         class="org.eclipse.gmf.helpDesigner.helpDesigner.diagram.application.ProblemsView"
         id="org.eclipse.gmf.helpDesigner.helpDesigner.views.ProblemsView"
         name="Problems">
   </view>
</extension>
<extension
      point="org.eclipse.ui.ide.markerSupport">
   <markerContentGenerator
         id="org.eclipse.gmf.helpDesigner.problemsGenerator"
         name="My Marker Generator">
         
         <markerTypeReference id="org.eclipse.emf.ecore.diagnostic"/>
             
        <markerFieldReference
         id="org.eclipse.ui.ide.severityAndDescriptionField"/>
   <markerFieldReference
         id="org.eclipse.ui.ide.locationField"/>
   <markerFieldReference
         id="org.eclipse.ui.ide.markerType"/>
   <markerFieldReference
         id="org.eclipse.ui.ide.priorityField"/>
   <markerFieldReference
         id="org.eclipse.ui.ide.resourceField"/> 
    </markerContentGenerator>
</extension>


and the following class
package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.application;
import org.eclipse.ui.views.markers.MarkerSupportView;

public class ProblemsView extends MarkerSupportView  {
	public ProblemsView() {
        super("org.eclipse.gmf.helpDesigner.problemsGenerator");
    }
}


does anybody have any tip?
It's really important to have a working marker view in my RCP app.

Thank you very much

[Updated on: Sun, 30 May 2010 08:59]

Report message to a moderator

Re: custom marker view in an RCP app using evl [message #536712 is a reply to message #536711] Sun, 30 May 2010 08:56 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Most probably it's your editor-specific marker type generated by GMF.
For example in
http://eclipse.org/gmt/epsilon/doc/articles/evl-gmf-integrat ion/ the
markers produced after performing validation in the GMF editor are of
type org.eclipse.epsilon.eugenia.examples.filesystem.diagram.diag nostic
(see Step 4)

Cheers,
Dimitris

giampow wrote:
> Hi all,
> I'm writing an RCP app based on EMF+GMF+EVL
> and I'm successfully validating my model against the constraints I've
> written in the evl file.
>
> Now I would like them to appear in the problems view, but it's not
> working: I've read that the problems view is not working with an RCP app.
>
> So I'm trying to implement a custom marker view in order to catch such
> markers.
>
> I'm followed the instructions on
> http://blog.eclipse-tips.com/2008/11/creating-custom-marker- view.html
> but can't get it work.
>
> What's the type of markers generated by evl?
> I thought it to be org.eclipse.emf.ecore.diagnostic.
>
> In my plugin.xml of the diagram plugin I've added the following code
>
>
> <extension
> point="org.eclipse.ui.views">
> <view
>
> class=" org.eclipse.gmf.helpDesigner.helpDesigner.diagram.applicatio n.ProblemsView "
>
> id=" org.eclipse.gmf.helpDesigner.helpDesigner.views.ProblemsView "
> name="Problems">
> </view>
> </extension>
> <extension
> point="org.eclipse.ui.ide.markerSupport">
> <markerContentGenerator
> id="org.eclipse.gmf.helpDesigner.problemsGenerator"
> name="My Marker Generator">
> <markerTypeReference
> id="org.eclipse.emf.ecore.diagnostic"/>
> <markerFieldReference
> id="org.eclipse.ui.ide.severityAndDescriptionField"/>
> <markerFieldReference
> id="org.eclipse.ui.ide.locationField"/>
> <markerFieldReference
> id="org.eclipse.ui.ide.markerType"/>
> <markerFieldReference
> id="org.eclipse.ui.ide.priorityField"/>
> <markerFieldReference
> id="org.eclipse.ui.ide.resourceField"/>
> </markerContentGenerator>
> </extension>
>
>
> does anybody have any tip?
> It's really important to have a working marker view in my RCP app.
>
> Thank you very much
Re: custom marker view in an RCP app using evl [message #536714 is a reply to message #536712] Sun, 30 May 2010 09:15 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you for your reply,
I've tried to properly change the marker type according to what is defined in my validator plugin, but it's still not working.

I've got different plugin.xml files (for the validator plugin, for the model, for the diagram....),
maybe I need to put the view definition and the extension point for org.eclipse.ui.ide.markerSupport in another plugin.xml file?

Thank you,
I appreciate very much your work
Re: custom marker view in an RCP app using evl [message #536717 is a reply to message #536714] Sun, 30 May 2010 09:18 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

I must admit I don't have much experience with EVL under RCP but I'd be
happy to have a look at your code if you could zip your project and send
it to me at dskolovos gmail com (or if you could grant me temporary
access to your CVS/SVN if you're using one).

Cheers,
Dimitris

giampow wrote:
> Hi Dimitris,
> thank you for your reply,
> I've tried to properly change the marker type according to what is
> defined in my validator plugin, but it's still not working.
>
> I've got different plugin.xml files (for the validator plugin, for the
> model, for the diagram....),
> maybe I need to put the view definition and the extension point for
> org.eclipse.ui.ide.markerSupport in another plugin.xml file?
>
> Thank you,
> I appreciate very much your work
Re: custom marker view in an RCP app using evl [message #536726 is a reply to message #536717] Sun, 30 May 2010 11:53 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
I've sent to you my project by email.

I've tried to run it as a non RCP app, and in that case it works.
I mean, both the standard problems view and my custom marker view work.

Through the use of the debugger I've seen that, when running as RCP, the class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
can't recognize my diagram specific marker type generated by GMF.

More precisely, in that class the following call results into a null pointer exception
MarkerTypesModel.getInstance().getType(elementName)

where
elementName 
is the id of my GMF specific marker.

If running as non RCP, this marker type is beeing recognized and the views work.

So I think the problem is something related to the eclipse architecture.

The following are markers "seen" by org.eclipse.ui.internal.views.markers.MarkerContentGenerator when running as RCP, where the GMF specific marker type is not included:

org.eclipse.gmf.runtime.common.ui.services.bookmark
org.eclipse.emf.validation.problem
org.eclipse.emf.ecore.diagnostic
org.eclipse.xsd.diagnostic
org.eclipse.core.resources.marker
org.eclipse.core.resources.bookmark
org.eclipse.debug.core.breakpointMarker
org.eclipse.core.resources.problemmarker
org.eclipse.core.resources.taskmarker
org.eclipse.gmf.runtime.common.ui.services.marker
org.eclipse.debug.core.lineBreakpointMarker

When running as a non RCP app, in the list appears more markers, among which my GMF generated one is present.

Its supertypes are:

org.eclipse.core.resources.problemmarker
org.eclipse.gmf.runtime.common.ui.services.marker

In my opinion this is a design flaw of RCP, since it should be possible to reuse in RCP the code written for a non RCP app, especially if it's a custom marker view.

Thank you

[Updated on: Sun, 30 May 2010 15:27]

Report message to a moderator

Re: custom marker view in an RCP app using evl [message #536784 is a reply to message #536726] Sun, 30 May 2010 23:09 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

My (possibly wild) guess is that this happens because the marker view /
marker content generator mechanism, somehow assumes that there is a
workspace (which is true when you run your editor as a plugin but not
true when you run it as an RCP). I've been digging through the code to
see where this assumption is made and how it can be fixed with little
success. I'll have a look at this again tomorrow.

Cheers,
Dimitris

On 30/05/2010 12:54, giampow wrote:
> Hi Dimitris,
> I've sent to you my project by email.
>
> I've tried to run it as a non RCP app, and in that case it works.
> I mean, both the standard problems view and my custom marker view work.
>
> Through the use of the debugger I've seen that, when running as RCP, the
> class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
> can't recognize my diagram specific marker type generated by GMF.
>
> If running as non RCP, this marker type is beeing recognized and the
> views work.
>
> So I think the problem is something related to the eclipse architecture.
>
> These are markers "seen" by
> org.eclipse.ui.internal.views.markers.MarkerContentGenerator when
> running as RCP, where the GMF specific marker type is not included:
>
> org.eclipse.gmf.runtime.common.ui.services.bookmark
> org.eclipse.emf.validation.problem
> org.eclipse.emf.ecore.diagnostic
> org.eclipse.xsd.diagnostic
> org.eclipse.core.resources.marker
> org.eclipse.core.resources.bookmark
> org.eclipse.debug.core.breakpointMarker
> org.eclipse.core.resources.problemmarker
> org.eclipse.core.resources.taskmarker
> org.eclipse.gmf.runtime.common.ui.services.marker
> org.eclipse.debug.core.lineBreakpointMarker
>
> In my opinion this is a design flaw, since it should be possible to
> reuse in RCP the code written for a non RCP app, especially if it's a
> custom marker view.
>
> Thank you
Re: custom marker view in an RCP app using evl [message #536786 is a reply to message #536784] Sun, 30 May 2010 23:39 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
If my guess is valid then you'll need to implement a problems view from
scratch which will use a job to periodically iterate through all open
diagram editors and collect the error markers in each one of them.

Cheers,
Dimitris

On 31/05/2010 00:09, Dimitris Kolovos wrote:
> Hi,
>
> My (possibly wild) guess is that this happens because the marker view /
> marker content generator mechanism, somehow assumes that there is a
> workspace (which is true when you run your editor as a plugin but not
> true when you run it as an RCP). I've been digging through the code to
> see where this assumption is made and how it can be fixed with little
> success. I'll have a look at this again tomorrow.
>
> Cheers,
> Dimitris
>
> On 30/05/2010 12:54, giampow wrote:
>> Hi Dimitris,
>> I've sent to you my project by email.
>>
>> I've tried to run it as a non RCP app, and in that case it works.
>> I mean, both the standard problems view and my custom marker view work.
>>
>> Through the use of the debugger I've seen that, when running as RCP, the
>> class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
>> can't recognize my diagram specific marker type generated by GMF.
>>
>> If running as non RCP, this marker type is beeing recognized and the
>> views work.
>>
>> So I think the problem is something related to the eclipse architecture.
>>
>> These are markers "seen" by
>> org.eclipse.ui.internal.views.markers.MarkerContentGenerator when
>> running as RCP, where the GMF specific marker type is not included:
>>
>> org.eclipse.gmf.runtime.common.ui.services.bookmark
>> org.eclipse.emf.validation.problem
>> org.eclipse.emf.ecore.diagnostic
>> org.eclipse.xsd.diagnostic
>> org.eclipse.core.resources.marker
>> org.eclipse.core.resources.bookmark
>> org.eclipse.debug.core.breakpointMarker
>> org.eclipse.core.resources.problemmarker
>> org.eclipse.core.resources.taskmarker
>> org.eclipse.gmf.runtime.common.ui.services.marker
>> org.eclipse.debug.core.lineBreakpointMarker
>>
>> In my opinion this is a design flaw, since it should be possible to
>> reuse in RCP the code written for a non RCP app, especially if it's a
>> custom marker view.
>>
>> Thank you
>
Re: custom marker view in an RCP app using evl [message #536861 is a reply to message #536786] Mon, 31 May 2010 09:59 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you very much for your investigation,
I will try to follow your advice.
Re: custom marker view in an RCP app using evl [message #537537 is a reply to message #536711] Wed, 02 June 2010 19:31 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
I've tried to create a MarkerSupportView containing a job which periodically retrieve all the validation markers.

Now I don't know how to show these markers in my MarkerSupportView.
Do you have any suggestion?

Thank you
Re: custom marker view in an RCP app using evl [message #537558 is a reply to message #537537] Wed, 02 June 2010 21:20 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

Not really. When I had a look at this a couple of days ago, my feeling
was that if I were to do this, I'd probably write a new view from
scratch as the existing MarkerSupportView seemed to be a too coupled
with the workspace-specific marker mechanism to be of any use without it
- but I may be wrong.

When you've implemented the view it'd be great if you could post it here
to spare the next person the trouble :), and please feel free to come
back if you have any further questions.

Cheers,
Dimitris

giampow wrote:
> I've tried to create a MarkerSupportView containing a job which
> periodically retrieve all the validation markers.
>
> Now I don't know how to show these markers in my MarkerSupportView.
> Do you have any suggestion?
>
> Thank you
Re: custom marker view in an RCP app using evl [message #537632 is a reply to message #536711] Thu, 03 June 2010 07:39 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,

I will try with a new View, but I'm quite new to development under Eclipse platform, so I don't know exactly how to show markers in a view.

My markers are generated by the epsilon evl plugin and they are provided with a quick fix, too, I want to show their messages in a table and to have the user to click them to open the quick fix popup.

When I am finished, for sure I'll post my solution, in order to share it with others.

Thank you
giampaolo
Re: custom marker view in an RCP app using evl [message #537677 is a reply to message #537632] Thu, 03 June 2010 11:06 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Giampaolo,

giampow wrote:
> Hi Dimitris,
>
> I will try with a new View, but I'm quite new to development under
> Eclipse platform, so I don't know exactly how to show markers in a view.
>
> My markers are generated by the epsilon evl plugin and they are provided
> with a quick fix, too, I want to show their messages in a table and to
> have the user to click them to open the quick fix popup.

I suspect you can reuse (in the worst case via copy-paste) code from
ExtendedMarkersView. I'd also send an email to the platform/rcp/gmf
newsgroups to see if anyone there has done something similar that
they're willing to share.

>
> When I am finished, for sure I'll post my solution, in order to share it
> with others.

Looking forward to this!

>
> Thank you
> giampaolo

Cheers,
Dimitris
Re: custom marker view in an RCP app using evl [message #537864 is a reply to message #536711] Thu, 03 June 2010 21:59 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
I've managed to implement a first working version of a custom problems view, written from scratch as a View using a TableViewer.

Here I'm posting my code,
now it works using a job which periodically refresh the marker list in the TableViewer component.

The next step, yet to be implemented, is to get a right-click context menu on each marker in the table, showing the "quick-fix" command.

Do you have any tip on how to show the quick-fix popup?

Thank you for the very valuable support

-----------
the view

package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;

import java.util.List;

import org.eclipse.jface.viewers.TableViewer;
import org.eclipse.jface.viewers.TableViewerColumn;
import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Table;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.part.ViewPart;

public class ProblemsView extends ViewPart {
	public static final String ID = "org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.ProblemsView";

	public TableViewer viewer;
	private UpdateJob updateJob;

	public void createPartControl(Composite parent) {
		createViewer(parent);
		updateJob = new UpdateJob("updateMarkers");
		IEditorPart editorPart = getSite().getPage().getActiveEditor();
		updateJob.setEditorPart(editorPart);
		updateJob.setProblemsView(this);
		updateJob.schedule();
		viewer.setInput(updateJob.getMarkerList());
	}

	private void createViewer(Composite parent) {
		viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
				| SWT.V_SCROLL | SWT.FULL_SELECTION);
		createColumns(viewer);
		viewer.setContentProvider(new MarkerContentProvider());
		viewer.setLabelProvider(new MarkerLabelProvider());
	}

	// This will create the columns for the table
	private void createColumns(TableViewer viewer) {

		String[] titles = { "Description", "Location", "Type" };
		int[] bounds = { 100, 100, 100 };

		for (int i = 0; i < titles.length; i++) {
			TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
			column.getColumn().setText(titles[i]);
			column.getColumn().setWidth(bounds[i]);
			column.getColumn().setResizable(true);
			column.getColumn().setMoveable(true);
		}
		Table table = viewer.getTable();
		table.setHeaderVisible(true);
		table.setLinesVisible(true);
	}

	/**
	 * Passing the focus request to the viewer's control.
	 */
	public void setFocus() {
		viewer.getControl().setFocus();
	}

	public static Display getDisplay() {
		Display display = Display.getCurrent();
		// may be null if outside the UI thread
		if (display == null)
			display = Display.getDefault();
		return display;
	}

	public void clearMarkers() {
		getDisplay().syncExec(new Runnable() {
			public void run() {
				while (viewer.getElementAt(0) != null) {
					viewer.remove(viewer.getElementAt(0));
				}
			}
		});
	}

	public void addMarkers(final List<ValidationMarker> markers) {
		getDisplay().syncExec(new Runnable() {
			public void run() {
				viewer.add(markers.toArray());
			}
		});
	}
}


which I've mapped in my plugin.xml of the diagram code generated by GMF with the following xml mapping

<extension
      point="org.eclipse.ui.views">
	   <view
	         class="org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.ProblemsView"
	         id="org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.ProblemsView"
	         icon="icons\eview16\problems_view.gif"
	         name="Problems view">
	   </view>
	</extension>


the job updating the markers
package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.gef.EditPartViewer;
import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.ui.IEditorPart;

public class UpdateJob extends Job {

	public UpdateJob(String name) {
		super(name);
	}

	private List<ValidationMarker> markerList;
	private IEditorPart editorPart;
	private ProblemsView problemsView;

	public List<ValidationMarker> getMarkerList() {
		return markerList;
	}

	public void setEditorPart(IEditorPart editorPart) {
		this.editorPart = editorPart;
	}

	public void setProblemsView(ProblemsView problemsView) {
		this.problemsView = problemsView;
	}

	protected IStatus run(IProgressMonitor monitor) {
		try {
			if (editorPart instanceof IDiagramWorkbenchPart) {
				final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart) editorPart;

				int severity = IStatus.INFO;

				EditPartViewer viewer = part.getDiagramEditPart().getViewer();

				View view = part.getDiagram();

				if (view == null) {
					return Status.CANCEL_STATUS;
				}

				problemsView.clearMarkers();

				for (Iterator it = view.eAllContents(); it.hasNext();) {
					EObject next = (EObject) it.next();
					if (next instanceof View) {
						ValidationMarker[] markers = ValidationMarker
								.getMarkers(viewer, ViewUtil
										.getIdStr((View) next));

						if (markers != null && markers.length > 0) {
							markerList = new ArrayList<ValidationMarker>();
							for (int i = 0; i < markers.length; i++) {
								markerList.add(markers[i]);
							}
							problemsView.addMarkers(markerList);
						}

					}
				}
			}
			return Status.OK_STATUS;
		} finally {
			schedule(2000); //runs every 2 seconds
		}
	}
}


a couple of classes responsible for drawing marker properties in the table
package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;

import java.util.List;

import org.eclipse.jface.viewers.IStructuredContentProvider;
import org.eclipse.jface.viewers.Viewer;

public class MarkerContentProvider implements IStructuredContentProvider {

	@Override
	public Object[] getElements(Object inputElement) {
		@SuppressWarnings("unchecked")
		List<ValidationMarker> markers = (List<ValidationMarker>) inputElement;
		return markers.toArray();
	}

	@Override
	public void dispose() {
	}

	@Override
	public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
	}

}


package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;

import org.eclipse.emf.common.util.Diagnostic;
import org.eclipse.jface.viewers.ITableLabelProvider;
import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.graphics.Image;

public class MarkerLabelProvider extends LabelProvider implements
		ITableLabelProvider {

	private static final Image ERROR = HelpDesignerDiagramEditorPlugin
			.getBundledImageDescriptor("icons/obj16/error_tsk.gif")
			.createImage();

	@Override
	public String getColumnText(Object element, int columnIndex) {
		ValidationMarker marker = (ValidationMarker) element;
		switch (columnIndex) {
		case 0:
			return marker.getMessage();
		case 1:
			return marker.getLocation();
		case 2:
			switch (marker.getStatusSeverity()) {
			case Diagnostic.OK:
				return "OK";
			case Diagnostic.INFO:
				return "Info";
			case Diagnostic.WARNING:
				return "Warning";
			case Diagnostic.ERROR:
				return "Error";
			default:
				throw new RuntimeException("Should not happen");
			}
		default:
			throw new RuntimeException("Should not happen");
		}

	}

	@Override
	public Image getColumnImage(Object element, int columnIndex) {
		if (columnIndex == 0) {
			switch (((ValidationMarker) element).getStatusSeverity()) {
			case Diagnostic.ERROR:
				return ERROR;
			}
		}
		return null;
	}

}

[Updated on: Thu, 03 June 2010 22:02]

Report message to a moderator

Re: custom marker view in an RCP app us ing evl [message #537877 is a reply to message #537864] Fri, 04 June 2010 01:51 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Giampaolo,

Many thanks for sharing your solution! Regarding quick-fixes, I'd use
the plugin spy (http://www.eclipse.org/pde/incubator/spy/) to find the
class of the popup window and take it from there.

Cheers,
Dimitris

giampow <giampow@gmail.com> wrote:
> Hi Dimitris,
> I've managed to implement a first working version of a custom problems
> view, written from scratch as a View using a TableViewer.
>
> Here I'm posting my code,
> now it works using a job which periodically refresh the marker list in
> the TableViewer component.
>
> The next step, yet to be implemented, is to get a right-click context
> menu on each marker in the table, showing the "quick-fix" command.
>
> Do you have any tip on how to show the quick-fix popup?
>
> Thank you for the very valuable support
>
>
> package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;
>
> import java.util.List;
>
> import org.eclipse.jface.viewers.TableViewer;
> import org.eclipse.jface.viewers.TableViewerColumn;
> import org.eclipse.swt.SWT;
> import org.eclipse.swt.widgets.Composite;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.swt.widgets.Table;
> import org.eclipse.ui.IEditorPart;
> import org.eclipse.ui.part.ViewPart;
>
> public class ProblemsView extends ViewPart {
> public static final String ID =
> " org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.Probl emsView ";
>
> public TableViewer viewer;
> private UpdateJob updateJob;
>
> public void createPartControl(Composite parent) {
> createViewer(parent);
> updateJob = new UpdateJob("updateMarkers");
> IEditorPart editorPart = getSite().getPage().getActiveEditor();
> updateJob.setEditorPart(editorPart);
> updateJob.setProblemsView(this);
> updateJob.schedule();
> viewer.setInput(updateJob.getMarkerList());
> }
>
> private void createViewer(Composite parent) {
> viewer = new TableViewer(parent, SWT.MULTI | SWT.H_SCROLL
> | SWT.V_SCROLL | SWT.FULL_SELECTION);
> createColumns(viewer);
> viewer.setContentProvider(new MarkerContentProvider());
> viewer.setLabelProvider(new MarkerLabelProvider());
> }
>
> // This will create the columns for the table
> private void createColumns(TableViewer viewer) {
>
> String[] titles = { "Description", "Location", "Type" };
> int[] bounds = { 100, 100, 100 };
>
> for (int i = 0; i < titles.length; i++) {
> TableViewerColumn column = new TableViewerColumn(viewer, SWT.NONE);
> column.getColumn().setText(titles[i]);
> column.getColumn().setWidth(bounds[i]);
> column.getColumn().setResizable(true);
> column.getColumn().setMoveable(true);
> }
> Table table = viewer.getTable();
> table.setHeaderVisible(true);
> table.setLinesVisible(true);
> }
>
> /**
> * Passing the focus request to the viewer's control.
> */
> public void setFocus() {
> viewer.getControl().setFocus();
> }
>
> public static Display getDisplay() {
> Display display = Display.getCurrent();
> // may be null if outside the UI thread
> if (display == null)
> display = Display.getDefault();
> return display;
> }
>
> public void clearMarkers() {
> getDisplay().syncExec(new Runnable() {
> public void run() {
> while (viewer.getElementAt(0) != null) {
> viewer.remove(viewer.getElementAt(0));
> }
> }
> });
> }
>
> public void addMarkers(final List<ValidationMarker> markers) {
> getDisplay().syncExec(new Runnable() {
> public void run() {
> viewer.add(markers.toArray());
> }
> });
> }
> }
>
>
> which I've mapped in my plugin.xml of the diagram code generated by
> GMF with the following xml mapping
>
>
> <extension
> point="org.eclipse.ui.views">
> <view
>
> class=" org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.Probl emsView "
>
> id=" org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part.Probl emsView "
> icon="icons\eview16\problems_view.gif"
> name="Problems view">
> </view>
> </extension>
>
>
> the job updating the markers
>
> package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;
>
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
> import org.eclipse.core.runtime.IProgressMonitor;
> import org.eclipse.core.runtime.IStatus;
> import org.eclipse.core.runtime.Status;
> import org.eclipse.core.runtime.jobs.Job;
> import org.eclipse.emf.ecore.EObject;
> import org.eclipse.gef.EditPartViewer;
> import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
> import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPa rt;
> import org.eclipse.gmf.runtime.notation.View;
> import org.eclipse.ui.IEditorPart;
>
> public class UpdateJob extends Job {
>
> public UpdateJob(String name) {
> super(name);
> }
>
> private List<ValidationMarker> markerList;
> private IEditorPart editorPart;
> private ProblemsView problemsView;
>
> public List<ValidationMarker> getMarkerList() {
> return markerList;
> }
>
> public void setEditorPart(IEditorPart editorPart) {
> this.editorPart = editorPart;
> }
>
> public void setProblemsView(ProblemsView problemsView) {
> this.problemsView = problemsView;
> }
>
> protected IStatus run(IProgressMonitor monitor) {
> try {
> if (editorPart instanceof IDiagramWorkbenchPart) {
> final IDiagramWorkbenchPart part = (IDiagramWorkbenchPart)
> editorPart;
>
> int severity = IStatus.INFO;
>
> EditPartViewer viewer = part.getDiagramEditPart().getViewer();
>
> View view = part.getDiagram();
>
> if (view == null) {
> return Status.CANCEL_STATUS;
> }
>
> problemsView.clearMarkers();
>
> for (Iterator it = view.eAllContents(); it.hasNext();) {
> EObject next = (EObject) it.next();
> if (next instanceof View) {
> ValidationMarker[] markers = ValidationMarker
> .getMarkers(viewer, ViewUtil
> .getIdStr((View) next));
>
> if (markers != null && markers.length > 0) {
> markerList = new ArrayList<ValidationMarker>();
> for (int i = 0; i < markers.length; i++) {
> markerList.add(markers[i]);
> }
> problemsView.addMarkers(markerList);
> }
>
> }
> }
> }
> return Status.OK_STATUS;
> } finally {
> schedule(2000); //runs every 2 seconds
> }
> }
> }
>
>
> a couple of classes responsible for drawing marker properties in the
> table
>
> package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;
>
> import java.util.List;
>
> import org.eclipse.jface.viewers.IStructuredContentProvider;
> import org.eclipse.jface.viewers.Viewer;
>
> public class MarkerContentProvider implements
> IStructuredContentProvider {
>
> @Override
> public Object[] getElements(Object inputElement) {
> @SuppressWarnings("unchecked")
> List<ValidationMarker> markers = (List<ValidationMarker>)
> inputElement;
> return markers.toArray();
> }
>
> @Override
> public void dispose() {
> }
>
> @Override
> public void inputChanged(Viewer viewer, Object oldInput, Object
> newInput) {
> }
>
> }
>
>
>
> package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;
>
> import org.eclipse.emf.common.util.Diagnostic;
> import org.eclipse.jface.viewers.ITableLabelProvider;
> import org.eclipse.jface.viewers.LabelProvider;
> import org.eclipse.swt.graphics.Image;
>
> public class MarkerLabelProvider extends LabelProvider implements
> ITableLabelProvider {
>
> private static final Image ERROR = HelpDesignerDiagramEditorPlugin
> .getBundledImageDescriptor("icons/obj16/error_tsk.gif")
> .createImage();
>
> @Override
> public String getColumnText(Object element, int columnIndex) {
> ValidationMarker marker = (ValidationMarker) element;
> switch (columnIndex) {
> case 0:
> return marker.getMessage();
> case 1:
> return marker.getLocation();
> case 2:
> switch (marker.getStatusSeverity()) {
> case Diagnostic.OK:
> return "OK";
> case Diagnostic.INFO:
> return "Info";
> case Diagnostic.WARNING:
> return "Warning";
> case Diagnostic.ERROR:
> return "Error";
> default:
> throw new RuntimeException("Should not happen");
> }
> default:
> throw new RuntimeException("Should not happen");
> }
>
> }
>
> @Override
> public Image getColumnImage(Object element, int columnIndex) {
> if (columnIndex == 0) {
> switch (((ValidationMarker) element).getStatusSeverity()) {
> case Diagnostic.ERROR:
> return ERROR;
> }
> }
> return null;
> }
>
> }
>
>
>
> package org.eclipse.gmf.helpDesigner.helpDesigner.diagram.part;
>
> import java.util.List;
>
> import org.eclipse.jface.viewers.IStructuredContentProvider;
> import org.eclipse.jface.viewers.Viewer;
>
> public class MarkerContentProvider implements
> IStructuredContentProvider {
>
> @Override
> public Object[] getElements(Object inputElement) {
> @SuppressWarnings("unchecked")
> List<ValidationMarker> markers = (List<ValidationMarker>)
> inputElement;
> return markers.toArray();
> }
>
> @Override
> public void dispose() {
> }
>
> @Override
> public void inputChanged(Viewer viewer, Object oldInput, Object
> newInput) {
> }
>
> }
>
>
Re: custom marker view in an RCP app us ing evl [message #537893 is a reply to message #537877] Fri, 04 June 2010 06:34 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you for the tip, I will investigate on it and come back with the whole solution, if I manage to add the quick fix.

G

[Updated on: Fri, 04 June 2010 17:53]

Report message to a moderator

Re: custom marker view in an RCP app using evl [message #589523 is a reply to message #536712] Sun, 30 May 2010 09:15 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you for your reply,
I've tried to properly change the marker type according to what is defined in my validator plugin, but it's still not working.

I've got different plugin.xml files (for the validator plugin, for the model, for the diagram....),
maybe I need to put the view definition and the extension point for org.eclipse.ui.ide.markerSupport in another plugin.xml file?

Thank you,
I appreciate very much your work
Re: custom marker view in an RCP app using evl [message #589527 is a reply to message #589523] Sun, 30 May 2010 09:18 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

I must admit I don't have much experience with EVL under RCP but I'd be
happy to have a look at your code if you could zip your project and send
it to me at dskolovos gmail com (or if you could grant me temporary
access to your CVS/SVN if you're using one).

Cheers,
Dimitris

giampow wrote:
> Hi Dimitris,
> thank you for your reply,
> I've tried to properly change the marker type according to what is
> defined in my validator plugin, but it's still not working.
>
> I've got different plugin.xml files (for the validator plugin, for the
> model, for the diagram....),
> maybe I need to put the view definition and the extension point for
> org.eclipse.ui.ide.markerSupport in another plugin.xml file?
>
> Thank you,
> I appreciate very much your work
Re: custom marker view in an RCP app using evl [message #589533 is a reply to message #536717] Sun, 30 May 2010 11:54 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
I've sent to you my project by email.

I've tried to run it as a non RCP app, and in that case it works.
I mean, both the standard problems view and my custom marker view work.

Through the use of the debugger I've seen that, when running as RCP, the class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
can't recognize my diagram specific marker type generated by GMF.

If running as non RCP, this marker type is beeing recognized and the views work.

So I think the problem is something related to the eclipse architecture.

These are markers "seen" by org.eclipse.ui.internal.views.markers.MarkerContentGenerator when running as RCP, where the GMF specific marker type is not included:

org.eclipse.gmf.runtime.common.ui.services.bookmark
org.eclipse.emf.validation.problem
org.eclipse.emf.ecore.diagnostic
org.eclipse.xsd.diagnostic
org.eclipse.core.resources.marker
org.eclipse.core.resources.bookmark
org.eclipse.debug.core.breakpointMarker
org.eclipse.core.resources.problemmarker
org.eclipse.core.resources.taskmarker
org.eclipse.gmf.runtime.common.ui.services.marker
org.eclipse.debug.core.lineBreakpointMarker

In my opinion this is a design flaw, since it should be possible to reuse in RCP the code written for a non RCP app, especially if it's a custom marker view.

Thank you
Re: custom marker view in an RCP app using evl [message #589567 is a reply to message #589533] Sun, 30 May 2010 23:09 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi,

My (possibly wild) guess is that this happens because the marker view /
marker content generator mechanism, somehow assumes that there is a
workspace (which is true when you run your editor as a plugin but not
true when you run it as an RCP). I've been digging through the code to
see where this assumption is made and how it can be fixed with little
success. I'll have a look at this again tomorrow.

Cheers,
Dimitris

On 30/05/2010 12:54, giampow wrote:
> Hi Dimitris,
> I've sent to you my project by email.
>
> I've tried to run it as a non RCP app, and in that case it works.
> I mean, both the standard problems view and my custom marker view work.
>
> Through the use of the debugger I've seen that, when running as RCP, the
> class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
> can't recognize my diagram specific marker type generated by GMF.
>
> If running as non RCP, this marker type is beeing recognized and the
> views work.
>
> So I think the problem is something related to the eclipse architecture.
>
> These are markers "seen" by
> org.eclipse.ui.internal.views.markers.MarkerContentGenerator when
> running as RCP, where the GMF specific marker type is not included:
>
> org.eclipse.gmf.runtime.common.ui.services.bookmark
> org.eclipse.emf.validation.problem
> org.eclipse.emf.ecore.diagnostic
> org.eclipse.xsd.diagnostic
> org.eclipse.core.resources.marker
> org.eclipse.core.resources.bookmark
> org.eclipse.debug.core.breakpointMarker
> org.eclipse.core.resources.problemmarker
> org.eclipse.core.resources.taskmarker
> org.eclipse.gmf.runtime.common.ui.services.marker
> org.eclipse.debug.core.lineBreakpointMarker
>
> In my opinion this is a design flaw, since it should be possible to
> reuse in RCP the code written for a non RCP app, especially if it's a
> custom marker view.
>
> Thank you
Re: custom marker view in an RCP app using evl [message #589576 is a reply to message #536784] Sun, 30 May 2010 23:39 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
If my guess is valid then you'll need to implement a problems view from
scratch which will use a job to periodically iterate through all open
diagram editors and collect the error markers in each one of them.

Cheers,
Dimitris

On 31/05/2010 00:09, Dimitris Kolovos wrote:
> Hi,
>
> My (possibly wild) guess is that this happens because the marker view /
> marker content generator mechanism, somehow assumes that there is a
> workspace (which is true when you run your editor as a plugin but not
> true when you run it as an RCP). I've been digging through the code to
> see where this assumption is made and how it can be fixed with little
> success. I'll have a look at this again tomorrow.
>
> Cheers,
> Dimitris
>
> On 30/05/2010 12:54, giampow wrote:
>> Hi Dimitris,
>> I've sent to you my project by email.
>>
>> I've tried to run it as a non RCP app, and in that case it works.
>> I mean, both the standard problems view and my custom marker view work.
>>
>> Through the use of the debugger I've seen that, when running as RCP, the
>> class org.eclipse.ui.internal.views.markers.MarkerContentGenerator
>> can't recognize my diagram specific marker type generated by GMF.
>>
>> If running as non RCP, this marker type is beeing recognized and the
>> views work.
>>
>> So I think the problem is something related to the eclipse architecture.
>>
>> These are markers "seen" by
>> org.eclipse.ui.internal.views.markers.MarkerContentGenerator when
>> running as RCP, where the GMF specific marker type is not included:
>>
>> org.eclipse.gmf.runtime.common.ui.services.bookmark
>> org.eclipse.emf.validation.problem
>> org.eclipse.emf.ecore.diagnostic
>> org.eclipse.xsd.diagnostic
>> org.eclipse.core.resources.marker
>> org.eclipse.core.resources.bookmark
>> org.eclipse.debug.core.breakpointMarker
>> org.eclipse.core.resources.problemmarker
>> org.eclipse.core.resources.taskmarker
>> org.eclipse.gmf.runtime.common.ui.services.marker
>> org.eclipse.debug.core.lineBreakpointMarker
>>
>> In my opinion this is a design flaw, since it should be possible to
>> reuse in RCP the code written for a non RCP app, especially if it's a
>> custom marker view.
>>
>> Thank you
>
Re: custom marker view in an RCP app using evl [message #589588 is a reply to message #536786] Mon, 31 May 2010 09:59 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you very much for your investigation,
I will try to follow your advice.
Re: custom marker view in an RCP app using evl [message #589782 is a reply to message #537632] Thu, 03 June 2010 11:06 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Giampaolo,

giampow wrote:
> Hi Dimitris,
>
> I will try with a new View, but I'm quite new to development under
> Eclipse platform, so I don't know exactly how to show markers in a view.
>
> My markers are generated by the epsilon evl plugin and they are provided
> with a quick fix, too, I want to show their messages in a table and to
> have the user to click them to open the quick fix popup.

I suspect you can reuse (in the worst case via copy-paste) code from
ExtendedMarkersView. I'd also send an email to the platform/rcp/gmf
newsgroups to see if anyone there has done something similar that
they're willing to share.

>
> When I am finished, for sure I'll post my solution, in order to share it
> with others.

Looking forward to this!

>
> Thank you
> giampaolo

Cheers,
Dimitris
Re: custom marker view in an RCP app us ing evl [message #589808 is a reply to message #537877] Fri, 04 June 2010 06:34 Go to previous messageGo to next message
giampow Mising name is currently offline giampow Mising nameFriend
Messages: 31
Registered: May 2010
Member
Hi Dimitris,
thank you for the tip, I will investigate on it and come back with the whole solution, if I manage to add the quickl fix.

G
Re: custom marker view in an RCP app using evl [message #628889 is a reply to message #536711] Fri, 24 September 2010 15:35 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Hello,

I have exactly the same problem with a standard gmf editor : the validation framework works fine when the application is launched as an eclipse plugin but, when exported as RCP the problems view remains empty.

I introduced the new Problems view as described in this thread (thanks a lot for the code) and the new Problems view gets populated.
But the figures on the diagram still don't have markers on them. So that is to be implemented. and also the relation between the entries in the Problem view and the figures.

So my question is: is the solution presented in this thread the only possible solution in order to use the validation framework in a gmf rcp application ? Or could one add a user workspace (with a workspace navigator) to the RCP in order to solve the problem.

Thanks,
emil.




Re: custom marker view in an RCP app using evl [message #628895 is a reply to message #628889] Fri, 24 September 2010 16:01 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Emil,

I must admit I haven't tried it but this looks promising:
http://giampow.blogspot.com/2010/06/eclipse-rcp-application- custom-problems.html

Cheers,
Dimitris

emil salageanu wrote:
> Hello,
> I have exactly the same problem with a standard gmf editor : the
> validation framework works fine when the application is launched as an
> eclipse plugin but, when exported as RCP the problems view remains empty.
> I introduced the new Problems view as described in this thread (thanks a
> lot for the code) and the new Problems view gets populated. But the
> figures on the diagram still don't have markers on them. So that is to
> be implemented. and also the relation between the entries in the Problem
> view and the figures.
> So my question is: is the solution presented in this thread the only
> possible solution in order to use the validation framework in a gmf rcp
> application ? Or could one add a user workspace (with a workspace
> navigator) to the RCP in order to solve the problem.
> Thanks, emil.
>
>
>
Re: custom marker view in an RCP app using evl [message #629096 is a reply to message #628895] Mon, 27 September 2010 08:17 Go to previous messageGo to next message
emil salageanu is currently offline emil salageanuFriend
Messages: 94
Registered: June 2010
Location: Nice, France
Member
Hi Dimitri,

Yes the blog you pointed is ok, the code works fine (it still needs improvements but the a big part of the work to do is already there).
But my problem remains the same:
I'm still trying to find a way to use the eclipse problems framework without having to re-implement it.
Anyways, thanks a lot for your answer. As soon as I find a solution (and I have a deadline of 2 weeks Smile ) I'll come back and post it here.

Cheers,
Emil.

Re: custom marker view in an RCP app using evl [message #641272 is a reply to message #629096] Wed, 24 November 2010 17:21 Go to previous messageGo to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
I am in the same project situation.EMF+GMF+EVL validation on a RCP application.I follow the instructions from here: http://giampow.blogspot.com/2010/06/eclipse-rcp-application- custom-problems.html

But i still can't see the new promlems view.
I created the new ProblemsView class , then i added a new extention org.eclipse.ui.views. and i implemented the UpdateJob class the MarkerContentProvider ,and the MarkerLabelProvider with a little change at the ERROR var,which is now pointed at my gif file.

I did't receive and errors but when i launched it again .the new view was not there.

Any ideas?

Thank you
Re: custom marker view in an RCP app using evl [message #641320 is a reply to message #641272] Wed, 24 November 2010 22:59 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Have you added the view to your RCP app perspective?

Cheers,
Dimitris

lalakis wrote:
> I am in the same project situation.EMF+GMF+EVL validation on a RCP
> application.I follow the instructions from here:
> http://giampow.blogspot.com/2010/06/eclipse-rcp-application- custom-problems.html
>
>
> But i still can't see the new promlems view.
> I created the new ProblemsView class , then i added a new extention
> org.eclipse.ui.views. and i implemented the UpdateJob class the
> MarkerContentProvider ,and the MarkerLabelProvider with a little change
> at the ERROR var,which is now pointed at my gif file.
>
> I did't receive and errors but when i launched it again .the new view
> was not there.
>
> Any ideas?
>
> Thank you
Re: custom marker view in an RCP app using evl [message #641392 is a reply to message #641320] Thu, 25 November 2010 10:20 Go to previous messageGo to next message
lalakis  is currently offline lalakis Friend
Messages: 48
Registered: October 2009
Member
What i did ,was to:
- define a new org.eclipse.ui.perspective extension where i declared my new perspective
- define a new org.eclipse.ui.perspectiveExtension extension where i associate my perspective with my new view

and in the end i have changed a little bit the code of my perspective class where i added this code :
 

package atagmetamodel.diagram.application;

import org.eclipse.ui.IFolderLayout;
import org.eclipse.ui.IPageLayout;
import org.eclipse.ui.IPerspectiveFactory;

import atagmetamodel.diagram.part.ProblemsView;

/**
 * @generated
 */
public class DiagramEditorPerspective implements IPerspectiveFactory {
	/**
	 * @generated
	 */
	public void createInitialLayout(IPageLayout layout) {
		layout.setEditorAreaVisible(true);
		layout.addPerspectiveShortcut(DiagramEditorWorkbenchAdvisor.PERSPECTIVE_ID);
		IFolderLayout right = layout.createFolder(
				"right", IPageLayout.RIGHT, 0.6f, layout.getEditorArea()); //$NON-NLS-1$
		right.addView(IPageLayout.ID_OUTLINE);
		IFolderLayout bottomRight = layout.createFolder(
				"bottomRight", IPageLayout.BOTTOM, 0.6f, "right"); //$NON-NLS-1$	 //$NON-NLS-2$
		bottomRight.addView(IPageLayout.ID_PROP_SHEET);
		bottomRight.addView(ProblemsView.ID);

	}
	public void defineActions(IPageLayout layout) {
        
        // Add "show views".
        layout.addShowViewShortcut(ProblemsView.ID);
}
}




But after that nothing happened at my rcp app.The only views that i could see were the properties and the console.

Thank you
Re: custom marker view in an RCP app using evl [message #641399 is a reply to message #641392] Thu, 25 November 2010 10:49 Go to previous message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
You probably need to reset your perspective to make your view appear.

Cheers,
Dimitris

lalakis wrote:
> What i did ,was to:
> - define a new org.eclipse.ui.perspective extension where i declared my
> new perspective - define a new org.eclipse.ui.perspectiveExtension
> extension where i associate my perspective with my new view
>
> and in the end i have changed a little bit the code of my perspective
> class where i added this code :
>
>
> package atagmetamodel.diagram.application;
>
> import org.eclipse.ui.IFolderLayout;
> import org.eclipse.ui.IPageLayout;
> import org.eclipse.ui.IPerspectiveFactory;
>
> import atagmetamodel.diagram.part.ProblemsView;
>
> /**
> * @generated
> */
> public class DiagramEditorPerspective implements IPerspectiveFactory {
> /**
> * @generated
> */
> public void createInitialLayout(IPageLayout layout) {
> layout.setEditorAreaVisible(true);
>
> layout.addPerspectiveShortcut(DiagramEditorWorkbenchAdvisor. PERSPECTIVE_ID);
>
> IFolderLayout right = layout.createFolder(
> "right", IPageLayout.RIGHT, 0.6f,
> layout.getEditorArea()); //$NON-NLS-1$
> right.addView(IPageLayout.ID_OUTLINE);
> IFolderLayout bottomRight = layout.createFolder(
> "bottomRight", IPageLayout.BOTTOM, 0.6f, "right");
> //$NON-NLS-1$ //$NON-NLS-2$
> bottomRight.addView(IPageLayout.ID_PROP_SHEET);
> bottomRight.addView(ProblemsView.ID);
>
> }
> public void defineActions(IPageLayout layout) {
> // Add "show views".
> layout.addShowViewShortcut(ProblemsView.ID);
> }
> }
>
>
>
>
> But after that nothing happened at my rcp app.The only views that i
> could see were the properties and the console.
>
> Thank you
Previous Topic:Problem with HUTN configuration files
Next Topic:[EWL] combo box for User Input
Goto Forum:
  


Current Time: Thu Mar 28 20:31:32 GMT 2024

Powered by FUDForum. Page generated in 0.06578 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top