Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Problem with EReference
Problem with EReference [message #894869] Tue, 10 July 2012 20:30 Go to next message
rama hana is currently offline rama hana
Messages: 10
Registered: July 2012
Junior Member
Hello,

I have a problem when adding an ERefernce to my editor. In fact, when opening the editor, the Ereference is already added to palette,then, when i try to draw a connection from SecondEClass2 to SecondEClass1, the arrow cannot be visualized in the editor (see image 1) like in the tutorial. However, when expanding the SecondEClass2 in the project explorer, we could observe that an Erefrence is added to the SecondEClass2 (see image 2)

could anyone explain me what is the matter ?
Thanks in advance.
  • Attachment: image 1.JPG
    (Size: 19.38KB, Downloaded 94 times)
  • Attachment: image 2.JPG
    (Size: 13.04KB, Downloaded 102 times)
Re: Problem with EReference [message #894921 is a reply to message #894869] Wed, 11 July 2012 06:07 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1621
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Is there any exception written to the Eclipse error log? If there is none can you post the coding of your add connection feature?

Michael
Re: Problem with EReference [message #895179 is a reply to message #894869] Wed, 11 July 2012 21:46 Go to previous messageGo to next message
rama hana is currently offline rama hana
Messages: 10
Registered: July 2012
Junior Member
Thank you for your answer.
I have proceeded exactly like in the tutorial. Here is the code:
The TutorialCreateEReferenceFeature.java :

public class TutorialCreateEReferenceFeature extends
       AbstractCreateConnectionFeature {

 
    public TutorialCreateEReferenceFeature (IFeatureProvider fp) {

        // provide name and description for the UI, e.g. the palette

        super(fp, "EReference", "Create EReference");

    }

    public boolean canCreate(ICreateConnectionContext context) {

        // return true if both anchors belong to an EClass

        // and those EClasses are not identical

        EClass source = getEClass(context.getSourceAnchor());

        EClass target = getEClass(context.getTargetAnchor());

        if (source != null && target != null && source != target) {

            return true;
        }
        return false;
    }

    public boolean canStartConnection(ICreateConnectionContext context) {

        // return true if start anchor belongs to a EClass

        if (getEClass(context.getSourceAnchor()) != null) {

            return true;
        }
        return false;
    }

    public Connection create(ICreateConnectionContext context) {

        Connection newConnection = null;

        // get EClasses which should be connected

        EClass source = getEClass(context.getSourceAnchor());

        EClass target = getEClass(context.getTargetAnchor());

        if (source != null && target != null) {

            // create new business object 

            EReference eReference = createEReference(source, target);

            // add connection for business object

            AddConnectionContext addContext =

                new AddConnectionContext(context.getSourceAnchor(), context

                    .getTargetAnchor());

            addContext.setNewObject(eReference);

            newConnection =

                (Connection) getFeatureProvider().addIfPossible(addContext);

        }
        return newConnection;

    }
    /**

     * Returns the EClass belonging to the anchor, or null if not available.

     */

    private EClass getEClass(Anchor anchor) {

        if (anchor != null) {

            Object object =

                getBusinessObjectForPictogramElement(anchor.getParent());

            if (object instanceof EClass) {

                return (EClass) object;

            }

        }

        return null;

    }
    /**

    * Creates a EReference between two EClasses.

    */

    private EReference createEReference(EClass source, EClass target) {

        EReference eReference = EcoreFactory.eINSTANCE.createEReference();

        eReference.setName("new EReference");

        eReference.setEType(target);

        eReference.setLowerBound(0);

        eReference.setUpperBound(1);

        source.getEStructuralFeatures().add(eReference);

        return eReference;

   }

}


The TutorialFeatureProvider.java :

public class TutorialFeatureProvider extends DefaultFeatureProvider {
	public TutorialFeatureProvider(IDiagramTypeProvider dtp) {
		super(dtp);
	}
	public IAddFeature getAddFeature(IAddContext context) {
		//is object for add request a EClass?
		if (context.getNewObject() instanceof EClass) {
		return new TutorialAddEClassFeature(this);
		}
		return super.getAddFeature(context);
		}
	 @Override

	    public ICreateFeature[] getCreateFeatures() {

	        return new ICreateFeature[] { new TutorialCreateEClassFeature(this) };

	    }
	 @Override

	    public ICreateConnectionFeature[] getCreateConnectionFeatures() {

	        return new ICreateConnectionFeature[] { 

	            new TutorialCreateEReferenceFeature (this) };
	    }
}


The TutorialAddEClassFeature.java :

public class TutorialAddEClassFeature extends AbstractAddShapeFeature {

    private static final IColorConstant CLASS_TEXT_FOREGROUND =

        new ColorConstant(51, 51, 153);

    private static final IColorConstant CLASS_FOREGROUND =

        new ColorConstant(255, 102, 0);
 

    private static final IColorConstant CLASS_BACKGROUND =

        new ColorConstant(255, 204, 153); 

    public TutorialAddEClassFeature(IFeatureProvider fp) {

        super(fp);

    }

    public boolean canAdd(IAddContext context) {

        // check if user wants to add a EClass

        if (context.getNewObject() instanceof EClass) {

            // check if user wants to add to a diagram

            if (context.getTargetContainer() instanceof Diagram) {

                return true;
            }
        }
        return false;

    }

    @SuppressWarnings("deprecation")
	public PictogramElement add(IAddContext context) {

        EClass addedClass = (EClass) context.getNewObject();

        Diagram targetDiagram = (Diagram) context.getTargetContainer();

        // CONTAINER SHAPE WITH ROUNDED RECTANGLE

        IPeCreateService peCreateService = Graphiti.getPeCreateService();
        ContainerShape containerShape =

             peCreateService.createContainerShape(targetDiagram, true);

        // define a default size for the shape

        int width = 100;

        int height = 50; 

        IGaService gaService = Graphiti.getGaService();

        {

            // create and set graphics algorithm

            RoundedRectangle roundedRectangle =

                gaService.createRoundedRectangle(containerShape, 5, 5);

            roundedRectangle.setForeground(manageColor(CLASS_FOREGROUND));

            roundedRectangle.setBackground(manageColor(CLASS_BACKGROUND));

            roundedRectangle.setLineWidth(2);

            gaService.setLocationAndSize(roundedRectangle,

                context.getX(), context.getY(), width, height);

 

            // if added Class has no resource we add it to the resource 
            // of the diagram

            // in a real scenario the business model would have its own resource

            if (addedClass.eResource() == null) {

                     getDiagram().eResource().getContents().add(addedClass);

            }

            // create link and wire it

            link(containerShape, addedClass);

        }

        // SHAPE WITH LINE

        {

            // create shape for line

            Shape shape = peCreateService.createShape(containerShape, false);

            // create and set graphics algorithm

            Polyline polyline =

                gaService.createPolyline(shape, new int[] { 0, 20, width, 20 });

            polyline.setForeground(manageColor(CLASS_FOREGROUND));

            polyline.setLineWidth(2);

        }

        // SHAPE WITH TEXT

        {

            // create shape for text

            Shape shape = peCreateService.createShape(containerShape, false);

            // create and set text graphics algorithm

            Text text = gaService.createDefaultText(getDiagram(), shape,
                        addedClass.getName());

            text.setForeground(manageColor(CLASS_TEXT_FOREGROUND));

            text.setHorizontalAlignment(Orientation.ALIGNMENT_CENTER);

            text.setVerticalAlignment(Orientation.ALIGNMENT_CENTER);

            text.getFont().setBold(true);

            gaService.setLocationAndSize(text, 0, 0, width, 20);

            // create link and wire it

            link(shape, addedClass);
        }
               
        // add a chopbox anchor to the shape 

        peCreateService.createChopboxAnchor(containerShape);

        return containerShape;
    }
}


There is another indication. I have tried to create a new Graphiti diagram based on the diagram type "tutorial" (that's the diagram type given with graphiti example) -See attachment test-tutorial.JPG. On the other hand, I have created another graphiti diagram based on the diagram type "mytutorial" (that's the digram type of my example)
- See attachment test-mytutorial.JPG.
I have realised that the editors of the two diagrams are not the same like indicated in attachment.


Re: Problem with EReference [message #895180 is a reply to message #895179] Wed, 11 July 2012 21:54 Go to previous messageGo to next message
rama hana is currently offline rama hana
Messages: 10
Registered: July 2012
Junior Member
Yes there is error log :

!ENTRY org.eclipse.ui 4 0 2012-04-21 13:57:05.123
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.RuntimeException: java.net.UnknownHostException: www.eclipse.org
	at org.eclipse.amalgam.discovery.modeling.handlers.ModelingDiscoveryHandler$1.load(ModelingDiscoveryHandler.java:63)
	at org.eclipse.amalgam.discovery.ui.viewer.DiscoveryContentProvider.getDiscovery(DiscoveryContentProvider.java:33)
	at org.eclipse.amalgam.discovery.ui.viewer.DiscoveryViewer.getDiscovery(DiscoveryViewer.java:1116)
	at org.eclipse.amalgam.discovery.ui.viewer.DiscoveryViewer.<init>(DiscoveryViewer.java:498)
	at org.eclipse.amalgam.discovery.ui.wizards.internal.DiscoveryWizardMainPage.createControl(DiscoveryWizardMainPage.java:56)
	at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:174)
	at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:736)
	at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:608)
	at org.eclipse.jface.window.Window.create(Window.java:431)
	at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1089)
	at org.eclipse.jface.window.Window.open(Window.java:790)
	at org.eclipse.amalgam.discovery.modeling.handlers.ModelingDiscoveryHandler.execute(ModelingDiscoveryHandler.java:83)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:293)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:169)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:241)
	at org.eclipse.ui.menus.CommandContributionItem.handleWidgetSelection(CommandContributionItem.java:829)
	at org.eclipse.ui.menus.CommandContributionItem.access$19(CommandContributionItem.java:815)
	at org.eclipse.ui.menus.CommandContributionItem$5.handleEvent(CommandContributionItem.java:805)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.net.UnknownHostException: www.eclipse.org
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.net.NetworkClient.doConnect(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.openServer(Unknown Source)
	at sun.net.www.http.HttpClient.<init>(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.http.HttpClient.New(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
	at org.eclipse.emf.ecore.resource.impl.URIHandlerImpl.createInputStream(URIHandlerImpl.java:178)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:350)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1262)
	at org.eclipse.amalgam.discovery.modeling.handlers.ModelingDiscoveryHandler$1.load(ModelingDiscoveryHandler.java:58)
	... 43 more
!SESSION 2012-06-21 23:27:06.708 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.modeling.product

!ENTRY org.eclipse.epp.usagedata.recording 1 0 2012-06-21 23:28:26.273
!MESSAGE Usage data uploaded to http://udc.eclipse.org/upload.php in 16668 milliseconds.
!SESSION 2012-06-24 16:25:51.382 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.modeling.product

!ENTRY org.eclipse.jface 4 0 2012-06-27 07:47:41.234
!MESSAGE Unhandled event loop exception during blocked modal context.
!STACK 0
org.eclipse.swt.SWTException: Failed to execute runnable (java.lang.NullPointerException)
	at org.eclipse.swt.SWT.error(SWT.java:4282)
	at org.eclipse.swt.SWT.error(SWT.java:4197)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:138)
	at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4140)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3757)
	at org.eclipse.jface.operation.ModalContext$ModalContextThread.block(ModalContext.java:173)
	at org.eclipse.jface.operation.ModalContext.run(ModalContext.java:388)
	at org.eclipse.jface.dialogs.ProgressMonitorDialog.run(ProgressMonitorDialog.java:507)
	at org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.run(ProgressMonitorJobsDialog.java:275)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.disconnectFromWorkspace(IDEWorkbenchAdvisor.java:515)
	at org.eclipse.ui.internal.ide.application.IDEWorkbenchAdvisor.postShutdown(IDEWorkbenchAdvisor.java:348)
	at org.eclipse.ui.internal.Workbench.shutdown(Workbench.java:3028)
	at org.eclipse.ui.internal.Workbench.busyClose(Workbench.java:1123)
	at org.eclipse.ui.internal.Workbench.access$15(Workbench.java:1040)
	at org.eclipse.ui.internal.Workbench$25.run(Workbench.java:1284)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1282)
	at org.eclipse.ui.internal.Workbench.close(Workbench.java:1254)
	at org.eclipse.ui.internal.WorkbenchWindow.busyClose(WorkbenchWindow.java:727)
	at org.eclipse.ui.internal.WorkbenchWindow.access$0(WorkbenchWindow.java:715)
	at org.eclipse.ui.internal.WorkbenchWindow$6.run(WorkbenchWindow.java:867)
	at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
	at org.eclipse.ui.internal.WorkbenchWindow.close(WorkbenchWindow.java:865)
	at org.eclipse.jface.window.Window.handleShellCloseEvent(Window.java:741)
	at org.eclipse.jface.window.Window$3.shellClosed(Window.java:687)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:98)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1077)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1062)
	at org.eclipse.swt.widgets.Decorations.closeWidget(Decorations.java:308)
	at org.eclipse.swt.widgets.Decorations.WM_CLOSE(Decorations.java:1677)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4530)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1610)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2061)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2526)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1610)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2061)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DefWindowProcW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DefWindowProc(OS.java:2526)
	at org.eclipse.swt.widgets.Shell.callWindowProc(Shell.java:498)
	at org.eclipse.swt.widgets.Control.windowProc(Control.java:4623)
	at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:341)
	at org.eclipse.swt.widgets.Decorations.windowProc(Decorations.java:1610)
	at org.eclipse.swt.widgets.Shell.windowProc(Shell.java:2061)
	at org.eclipse.swt.widgets.Display.windowProc(Display.java:4972)
	at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
	at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:2531)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3752)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
Caused by: java.lang.NullPointerException
	at org.eclipse.epp.usagedata.internal.ui.uploaders.AskUserUploader$1.getShell(AskUserUploader.java:69)
	at org.eclipse.epp.usagedata.internal.ui.uploaders.AskUserUploader$1.run(AskUserUploader.java:63)
	at org.eclipse.ui.internal.UILockListener.doPendingWork(UILockListener.java:164)
	at org.eclipse.ui.internal.UISynchronizer$3.run(UISynchronizer.java:158)
	at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
	at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
	... 73 more
!SESSION 2012-07-05 21:29:22.029 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.modeling.product

!ENTRY org.eclipse.epp.usagedata.recording 1 0 2012-07-05 21:30:26.491
!MESSAGE Usage data uploaded to http://udc.eclipse.org/upload.php in 2637 milliseconds.

!ENTRY org.eclipse.help 4 0 2012-07-05 21:31:38.737
!MESSAGE Error reading help table of contents file /"org.eclipse.gmf.doc/toc-runtime.xml" (skipping file)
!STACK 0
java.io.FileNotFoundException
	at org.eclipse.help.internal.toc.TocFileParser.parse(TocFileParser.java:49)
	at org.eclipse.help.internal.toc.TocFileProvider.getTocContributions(TocFileProvider.java:47)
	at org.eclipse.help.internal.toc.TocManager.getAndCacheTocContributions(TocManager.java:210)
	at org.eclipse.help.internal.toc.TocManager.getTocContributionsForToc(TocManager.java:199)
	at org.eclipse.help.internal.toc.TocManager.getRootTocContributions(TocManager.java:306)
	at org.eclipse.help.internal.toc.TocManager.getTocs(TocManager.java:68)
	at org.eclipse.help.internal.toc.TocManager.getTopic(TocManager.java:123)
	at org.eclipse.help.internal.toc.TocManager.getTopicPath(TocManager.java:138)
	at org.eclipse.help.internal.webapp.data.UrlUtil.getTopicPath(UrlUtil.java:216)
	at org.eclipse.help.internal.webapp.servlet.BreadcrumbsFilter.filter(BreadcrumbsFilter.java:75)
	at org.eclipse.help.internal.webapp.servlet.EclipseConnector.transfer(EclipseConnector.java:193)
	at org.eclipse.help.internal.webapp.servlet.ContentServlet.doGet(ContentServlet.java:45)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

!ENTRY org.eclipse.help 4 0 2012-07-05 21:31:38.774
!MESSAGE Error reading help table of contents file /"org.eclipse.gmf.doc/toc-tooling.xml" (skipping file)
!STACK 0
java.io.FileNotFoundException
	at org.eclipse.help.internal.toc.TocFileParser.parse(TocFileParser.java:49)
	at org.eclipse.help.internal.toc.TocFileProvider.getTocContributions(TocFileProvider.java:47)
	at org.eclipse.help.internal.toc.TocManager.getAndCacheTocContributions(TocManager.java:210)
	at org.eclipse.help.internal.toc.TocManager.getTocContributionsForToc(TocManager.java:199)
	at org.eclipse.help.internal.toc.TocManager.getRootTocContributions(TocManager.java:306)
	at org.eclipse.help.internal.toc.TocManager.getTocs(TocManager.java:68)
	at org.eclipse.help.internal.toc.TocManager.getTopic(TocManager.java:123)
	at org.eclipse.help.internal.toc.TocManager.getTopicPath(TocManager.java:138)
	at org.eclipse.help.internal.webapp.data.UrlUtil.getTopicPath(UrlUtil.java:216)
	at org.eclipse.help.internal.webapp.servlet.BreadcrumbsFilter.filter(BreadcrumbsFilter.java:75)
	at org.eclipse.help.internal.webapp.servlet.EclipseConnector.transfer(EclipseConnector.java:193)
	at org.eclipse.help.internal.webapp.servlet.ContentServlet.doGet(ContentServlet.java:45)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)
!SESSION 2012-07-06 21:01:40.099 -----------------------------------------------
eclipse.buildId=M20120208-0800
java.version=1.6.0_31
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=fr_FR
Framework arguments:  -product org.eclipse.epp.package.modeling.product
Command-line arguments:  -os win32 -ws win32 -arch x86 -product org.eclipse.epp.package.modeling.product

!ENTRY org.eclipse.core.resources 2 10035 2012-07-06 21:01:44.367
!MESSAGE The workspace exited with unsaved changes in the previous session; refreshing workspace to recover changes.

!ENTRY org.eclipse.help 4 0 2012-07-06 21:04:01.670
!MESSAGE Error reading help table of contents file /"org.eclipse.gmf.doc/toc-runtime.xml" (skipping file)
!STACK 0
java.io.FileNotFoundException
	at org.eclipse.help.internal.toc.TocFileParser.parse(TocFileParser.java:49)
	at org.eclipse.help.internal.toc.TocFileProvider.getTocContributions(TocFileProvider.java:47)
	at org.eclipse.help.internal.toc.TocManager.getAndCacheTocContributions(TocManager.java:210)
	at org.eclipse.help.internal.toc.TocManager.getTocContributionsForToc(TocManager.java:199)
	at org.eclipse.help.internal.toc.TocManager.getRootTocContributions(TocManager.java:306)
	at org.eclipse.help.internal.toc.TocManager.getTocs(TocManager.java:68)
	at org.eclipse.help.internal.toc.TocManager.getTopic(TocManager.java:123)
	at org.eclipse.help.internal.toc.TocManager.getTopicPath(TocManager.java:138)
	at org.eclipse.help.internal.webapp.data.UrlUtil.getTopicPath(UrlUtil.java:216)
	at org.eclipse.help.internal.webapp.servlet.BreadcrumbsFilter.filter(BreadcrumbsFilter.java:75)
	at org.eclipse.help.internal.webapp.servlet.EclipseConnector.transfer(EclipseConnector.java:193)
	at org.eclipse.help.internal.webapp.servlet.ContentServlet.doGet(ContentServlet.java:45)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

!ENTRY org.eclipse.help 4 0 2012-07-06 21:04:01.680
!MESSAGE Error reading help table of contents file /"org.eclipse.gmf.doc/toc-tooling.xml" (skipping file)
!STACK 0
java.io.FileNotFoundException
	at org.eclipse.help.internal.toc.TocFileParser.parse(TocFileParser.java:49)
	at org.eclipse.help.internal.toc.TocFileProvider.getTocContributions(TocFileProvider.java:47)
	at org.eclipse.help.internal.toc.TocManager.getAndCacheTocContributions(TocManager.java:210)
	at org.eclipse.help.internal.toc.TocManager.getTocContributionsForToc(TocManager.java:199)
	at org.eclipse.help.internal.toc.TocManager.getRootTocContributions(TocManager.java:306)
	at org.eclipse.help.internal.toc.TocManager.getTocs(TocManager.java:68)
	at org.eclipse.help.internal.toc.TocManager.getTopic(TocManager.java:123)
	at org.eclipse.help.internal.toc.TocManager.getTopicPath(TocManager.java:138)
	at org.eclipse.help.internal.webapp.data.UrlUtil.getTopicPath(UrlUtil.java:216)
	at org.eclipse.help.internal.webapp.servlet.BreadcrumbsFilter.filter(BreadcrumbsFilter.java:75)
	at org.eclipse.help.internal.webapp.servlet.EclipseConnector.transfer(EclipseConnector.java:193)
	at org.eclipse.help.internal.webapp.servlet.ContentServlet.doGet(ContentServlet.java:45)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.registry.internal.ServletManager$ServletWrapper.service(ServletManager.java:180)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:126)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:68)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:317)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:390)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:326)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
	at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:924)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:549)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
	at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:409)
	at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:582)

!ENTRY org.eclipse.epp.usagedata.recording 1 0 2012-07-10 21:34:44.206
!MESSAGE Usage data uploaded to http://udc.eclipse.org/upload.php in 13729 milliseconds.
Re: Problem with EReference [message #895220 is a reply to message #895179] Thu, 12 July 2012 07:56 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1621
Registered: July 2009
Location: Walldorf, Germany
Senior Member
I think the if branch

if (context.getNewObject() instanceof EReference) {
return new TutorialAddERefenceFeature(this);
}

is missing in the method getAddFeature of your feature provider.

Regarding the differences in the palette of the editors. This is caused by
some later additions in the tutorial adding the lower stuff. The Tutorial
diagram editor included with Graphiti shows the final version after working
through the complete tutorial.

Michael
Re: Problem with EReference [message #895641 is a reply to message #895220] Sat, 14 July 2012 00:08 Go to previous message
rama hana is currently offline rama hana
Messages: 10
Registered: July 2012
Junior Member
You are right Smile Thank you Micheal !
Previous Topic:Custom editor and toolbar items
Next Topic:Error : Unable to find feature.xml
Goto Forum:
  


Current Time: Fri Oct 31 07:14:42 GMT 2014

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

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