コード例 #1
0
        public override void dataReveicedEvent()
        {
            List <String> receivedLines = EMoflonTCPServer.getReadLines(buffer);

            if (receivedLines.Count > 0)
            {
                if (receivedLines[0].StartsWith("TEARDOWN_DEBUG_SESSION"))
                {
                    byte[] sendBuffer = EMoflonTCPServer.StringToByteArray(receivedLines[0] + EMoflonTCPServer.NEW_LINE);
                    stream.Write(sendBuffer, 0, sendBuffer.Length);
                    resetBuffer();
                    server.setReceiveDataStrategy(new StrategyChooseStrategy(server, repository));
                }
                else
                {
                    shouldTrace = trDialog.Accepted;
                    foreach (String line in receivedLines)
                    {
                        objects.Add(ValidationPropertyUtil.computeObjectFromPath(repository, line));
                    }
                    if (shouldTrace)
                    {
                        EAUtil.markObjectOnDiagram(objects[objects.Count - 1].EAObject, repository);
                        EAUtil.markObjectInProjectBrowser(objects[objects.Count - 1].EAObject, repository);
                        resetBuffer();
                        server.setReceiveDataStrategy(this);
                    }
                    else
                    {
                        server.setReceiveDataStrategy(new StrategyChooseStrategy(server, repository));
                    }
                }
            }
        }
コード例 #2
0
        public override void dataReveiced(List <string> receivedLines)
        {
            for (int i = 0; i < receivedLines.Count; i++)
            {
                String line = receivedLines[i];

                if (line == "SETUP_HIGHLIGHT_OBJECT")
                {
                    setIsActive(true);
                }

                else if (line == "TEARDOWN_HIGHLIGHT_OBJECT")
                {
                    setIsActive(false);
                }

                else if (isActive())
                {
                    try
                    {
                        PropertyObject propertyObject = ValidationPropertyUtil.computeObjectFromPath(sqlRep, line);
                        EAUtil.markObjectInProjectBrowser(propertyObject.EAObject, sqlRep);
                        if (propertyObject.EAObject is SQLDiagram)
                        {
                            SQLDiagram sqlDiagram = propertyObject.EAObject as SQLDiagram;
                            sqlRep.OpenDiagram(sqlDiagram.DiagramID);
                            Main.tcpServerFunctions.addStatusMessage("Displayed TGG Rule diagram: " + line);
                        }
                        else
                        {
                            int onDiagrams = EAUtil.markObjectOnDiagram(propertyObject.EAObject, sqlRep);
                            Main.tcpServerFunctions.addStatusMessage("Displayed object on diagram: " + line);
                        }
                    }
                    catch (NullReferenceException)
                    {
                        //something went wrong while computing the path
                        Main.tcpServerFunctions.addStatusMessage("An error occured while parsing the highlight object path from Eclipse: " + line);
                    }
                }
            }
            stream.WriteByte((byte)10);
        }
コード例 #3
0
        public override void dataReveiced(List <String> data)
        {
            List <String> receivedLines = data;

            try
            {
                if (receivedLines.Count > 0)
                {
                    if (receivedLines[0] == "SETUP_DEBUG_SESSION")
                    {
                        byte[] sendBuffer = EMoflonTCPServer.stringToByteArray(receivedLines[0] + Environment.NewLine);
                        stream.Write(sendBuffer, 0, sendBuffer.Length);
                        setIsActive(true);
                    }

                    else if (receivedLines[0].StartsWith("TEARDOWN_DEBUG_SESSION"))
                    {
                        byte[] sendBuffer = EMoflonTCPServer.stringToByteArray(receivedLines[0] + Environment.NewLine);
                        stream.Write(sendBuffer, 0, sendBuffer.Length);
                        setIsActive(false);
                    }
                    else if (isActive())
                    {
                        try
                        {
                            PropertyObject obj = ValidationPropertyUtil.computeObjectFromPath(rep, receivedLines[0]);
                            EAUtil.markObjectOnDiagram(obj.EAObject, rep);
                            EAUtil.markObjectInProjectBrowser(obj.EAObject, rep);
                        }
                        catch
                        {
                            setIsActive(false);
                        }
                    }
                }
            }
            catch (IOException)
            {
            }
        }
コード例 #4
0
        public void errorSelected(int index)
        {
            RuleResult ruleResult = this.shownResults[index];
            Object     eaObject   = ruleResult.EaObject;
            Rule       rule       = ruleControl.getRule(ruleResult.RuleID);

            //try to perform onClick action
            try
            {
                //"check" if eaObject still existing. otherwise throw exception -> result outdated
                Object eaObject2 = EAUtil.sqlEAObjectToOriginalObject(sqlRepository, ruleResult.EaObject);


                EAUtil.markObjectInProjectBrowser(eaObject, sqlRepository);
                EAUtil.markObjectOnDiagram(eaObject, sqlRepository);
            }
            //error during action. rule is outdated and should be removed from the output window
            catch
            {
                ruleControl.deleteRuleResult(rule.getRuleID(), ruleResult.ObjectID);
                writeOutput();
            }
        }