Adding Tabs in Glamour

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding Tabs in Glamour

Mohammad Al Houssami (Alumni)

Hello everyone,

First of all thanks to Tudor Girba for letting me know about the mailing list J

 

I am new to Glamour.
I was checking the examples and checking the code for the tree with expansion code. I am trying to add tabs. The only problem is that the tabs don’t have a similar function and I don’t want the transmit part to work for both.
To make things clearer I have want to show a DOM Tree in one column and when the tree is navigated attributes are shown on the second column. I want to have another tab that will just show the list of tokens that have been created during the parsing process. Because they are different, when you click on a token an error will be displayed because it does not understand the message being called.

Here is the code I have:

 

browseTree: htmlString

|browser domTree |

domTree := TreeConstruction new parse: htmlString.

                browser := GLMTabulator new.

                browser column: #one; column: #two.

                browser transmit to: #one; andShow: [:a |

                                a tree

                                                title: 'DOM Tree Browser';

                                                display: [ domTree htmlDocument  nodes first ];

                                                children: [:element :i | element  nodes];

                                                format: [:node|  node name].

                                a tree

                                title: 'Tokens List';

                                display:[domTree tokens]."Tokens get displayed here "                                                                             

                                                ].

                browser transmit to: #two; from: #one; andShow: [ :a | a text display: [:x | 'Attribute List ', x printAttributes  ] ].

                browser openOn: domTree  .

How can I achieve that? Or that is not possible?


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding Tabs in Glamour

Tudor Girba-2
One way would be to simply put conditions to when the transmission gets transmitted.

Suppose that the nodes are of type TreeNode and the tokens are of different type. Then you can use:

browser transmit to: #two; from: #one; andShow: [ :a | 
    a text 
display: [:x | 'Attribute List ', x printAttributes  ] ].

Cheers,
Doru


On Sun, Aug 25, 2013 at 11:58 AM, Mohammad Al Houssami (Alumni) <[hidden email]> wrote:

Hello everyone,

First of all thanks to Tudor Girba for letting me know about the mailing list J

 

I am new to Glamour.
I was checking the examples and checking the code for the tree with expansion code. I am trying to add tabs. The only problem is that the tabs don’t have a similar function and I don’t want the transmit part to work for both.
To make things clearer I have want to show a DOM Tree in one column and when the tree is navigated attributes are shown on the second column. I want to have another tab that will just show the list of tokens that have been created during the parsing process. Because they are different, when you click on a token an error will be displayed because it does not understand the message being called.

Here is the code I have:

 

browseTree: htmlString

|browser domTree |

domTree := TreeConstruction new parse: htmlString.

                browser := GLMTabulator new.

                browser column: #one; column: #two.

                browser transmit to: #one; andShow: [:a |

                                a tree

                                                title: 'DOM Tree Browser';

                                                display: [ domTree htmlDocument  nodes first ];

                                                children: [:element :i | element  nodes];

                                                format: [:node|  node name].

                                a tree

                                title: 'Tokens List';

                                display:[domTree tokens]."Tokens get displayed here "                                                                             

                                                ].

                browser transmit to: #two; from: #one; andShow: [ :a | a text display: [:x | 'Attribute List ', x printAttributes  ] ].

                browser openOn: domTree  .

How can I achieve that? Or that is not possible?


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding Tabs in Glamour

Tudor Girba-2
... I pressed too early

browser transmit to: #two; from: #one; when: [:node | node isKindOf: TreeNode]; andShow: [ :a | 
    a text display: [:x | 'Attribute List ', x printAttributes  ] ].

It's not the nicest solution, but it should do the job in your case.

Cheers,
Doru




On Sun, Aug 25, 2013 at 12:42 PM, Tudor Girba <[hidden email]> wrote:
One way would be to simply put conditions to when the transmission gets transmitted.

Suppose that the nodes are of type TreeNode and the tokens are of different type. Then you can use:

browser transmit to: #two; from: #one; andShow: [ :a | 
    a text 
display: [:x | 'Attribute List ', x printAttributes  ] ].

Cheers,
Doru


On Sun, Aug 25, 2013 at 11:58 AM, Mohammad Al Houssami (Alumni) <[hidden email]> wrote:

Hello everyone,

First of all thanks to Tudor Girba for letting me know about the mailing list J

 

I am new to Glamour.
I was checking the examples and checking the code for the tree with expansion code. I am trying to add tabs. The only problem is that the tabs don’t have a similar function and I don’t want the transmit part to work for both.
To make things clearer I have want to show a DOM Tree in one column and when the tree is navigated attributes are shown on the second column. I want to have another tab that will just show the list of tokens that have been created during the parsing process. Because they are different, when you click on a token an error will be displayed because it does not understand the message being called.

Here is the code I have:

 

browseTree: htmlString

|browser domTree |

domTree := TreeConstruction new parse: htmlString.

                browser := GLMTabulator new.

                browser column: #one; column: #two.

                browser transmit to: #one; andShow: [:a |

                                a tree

                                                title: 'DOM Tree Browser';

                                                display: [ domTree htmlDocument  nodes first ];

                                                children: [:element :i | element  nodes];

                                                format: [:node|  node name].

                                a tree

                                title: 'Tokens List';

                                display:[domTree tokens]."Tokens get displayed here "                                                                             

                                                ].

                browser transmit to: #two; from: #one; andShow: [ :a | a text display: [:x | 'Attribute List ', x printAttributes  ] ].

                browser openOn: domTree  .

How can I achieve that? Or that is not possible?


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"



--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Adding Tabs in Glamour

Mohammad Al Houssami (Alumni)

Works perfectly!!
Thank you
J

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Tudor Girba
Sent: Sunday, August 25, 2013 11:46 AM
To: Moose-related development
Subject: [Moose-dev] Re: Adding Tabs in Glamour

 

... I pressed too early

 

browser transmit to: #two; from: #one; when: [:node | node isKindOf: TreeNode]; andShow: [ :a | 

    a text display: [:x | 'Attribute List ', x printAttributes  ] ].

 

It's not the nicest solution, but it should do the job in your case.

 

Cheers,

Doru

 

 

 

On Sun, Aug 25, 2013 at 12:42 PM, Tudor Girba <[hidden email]> wrote:

One way would be to simply put conditions to when the transmission gets transmitted.

 

Suppose that the nodes are of type TreeNode and the tokens are of different type. Then you can use:

 

browser transmit to: #two; from: #one; andShow: [ :a | 

    a text 

display: [:x | 'Attribute List ', x printAttributes  ] ].

 

Cheers,

Doru

 

On Sun, Aug 25, 2013 at 11:58 AM, Mohammad Al Houssami (Alumni) <[hidden email]> wrote:

Hello everyone,

First of all thanks to Tudor Girba for letting me know about the mailing list J

 

I am new to Glamour.
I was checking the examples and checking the code for the tree with expansion code. I am trying to add tabs. The only problem is that the tabs don’t have a similar function and I don’t want the transmit part to work for both.
To make things clearer I have want to show a DOM Tree in one column and when the tree is navigated attributes are shown on the second column. I want to have another tab that will just show the list of tokens that have been created during the parsing process. Because they are different, when you click on a token an error will be displayed because it does not understand the message being called.

Here is the code I have:

 

browseTree: htmlString

|browser domTree |

domTree := TreeConstruction new parse: htmlString.

                browser := GLMTabulator new.

                browser column: #one; column: #two.

                browser transmit to: #one; andShow: [:a |

                                a tree

                                                title: 'DOM Tree Browser';

                                                display: [ domTree htmlDocument  nodes first ];

                                                children: [:element :i | element  nodes];

                                                format: [:node|  node name].

                                a tree

                                title: 'Tokens List';

                                display:[domTree tokens]."Tokens get displayed here "                                                                             

                                                ].

                browser transmit to: #two; from: #one; andShow: [ :a | a text display: [:x | 'Attribute List ', x printAttributes  ] ].

                browser openOn: domTree  .

How can I achieve that? Or that is not possible?

 

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



 

--

 

"Every thing has its own flow"



 

--

 

"Every thing has its own flow"


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev