Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF PrintAction
GEF PrintAction [message #230466] Mon, 12 February 2007 23:53 Go to next message
Kathiravan  is currently offline Kathiravan Friend
Messages: 33
Registered: July 2009
Member
I added a printaction to the ViewPart by calling the makeActions()
method inside the createControl Method.

private void makeActions() {
printAction = new PrintAction(getSite().getPart());
}

I can see the print action added to the viewpart. But it is always
disabled. How do i enable it?

Thanks in advance,

Regards
Kathir.
Re: GEF PrintAction [message #230577 is a reply to message #230466] Tue, 13 February 2007 12:43 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: jakub.jurkiewicz.gmail.com

Maybe try the method public void setEnabled(boolean enabled) that comes
from org.eclipse.jface.action.IAction interface (and PrintAction
implements this interface).

Let me know if it helps.
regards
Jakub Jurkiewicz


kathir wrote:
> I added a printaction to the ViewPart by calling the makeActions()
> method inside the createControl Method.
>
> private void makeActions() {
> printAction = new PrintAction(getSite().getPart());
> }
>
> I can see the print action added to the viewpart. But it is always
> disabled. How do i enable it?
>
> Thanks in advance,
>
> Regards
> Kathir.
Re: GEF PrintAction [message #230593 is a reply to message #230577] Tue, 13 February 2007 19:25 Go to previous messageGo to next message
Kathiravan  is currently offline Kathiravan Friend
Messages: 33
Registered: July 2009
Member
I did try setEnabled(true) but no luck. Still it is not enabled. Am i
missing anything

private void makeActions() {
printAction = new PrintAction(getSite().getPart());
//printAction = new PrintAction(this);
printAction.setEnabled(true);
}

Kathir.

Jakub Jurkiewicz wrote:
> Maybe try the method public void setEnabled(boolean enabled) that
> comes from org.eclipse.jface.action.IAction interface (and PrintAction
> implements this interface).
>
> Let me know if it helps.
> regards
> Jakub Jurkiewicz
>
>
> kathir wrote:
>> I added a printaction to the ViewPart by calling the makeActions()
>> method inside the createControl Method.
>>
>> private void makeActions() {
>> printAction = new PrintAction(getSite().getPart());
>> }
>>
>> I can see the print action added to the viewpart. But it is always
>> disabled. How do i enable it?
>>
>> Thanks in advance,
>>
>> Regards
>> Kathir.
Re: GEF PrintAction [message #230601 is a reply to message #230466] Tue, 13 February 2007 21:55 Go to previous message
Eclipse UserFriend
Originally posted by: none.unknown.com

Well, obviously, just creating the action is not enough. You need to
register it as the handler for the global action. The GraphicalEditor does
a lot of things for you automatically, so in there all you need to do is
create the action and add it to the action registry. But in a view of your
own, you'd have to set up everything yourself. I suggest that you
understand how actions work in Eclipse before you try to fix this problem.
Note that this topic is not related to GEF and falls under the domain of
platform.

"kathir" <kathir@gmail.com> wrote in message
news:eqqulj$as9$1@utils.eclipse.org...
>I added a printaction to the ViewPart by calling the makeActions() method
>inside the createControl Method.
>
> private void makeActions() {
> printAction = new PrintAction(getSite().getPart());
> }
>
> I can see the print action added to the viewpart. But it is always
> disabled. How do i enable it?
>
> Thanks in advance,
>
> Regards
> Kathir.
Previous Topic:GEF ChangeConstraint Problem
Next Topic:setClip(path) error on overview
Goto Forum:
  


Current Time: Fri Apr 26 15:39:16 GMT 2024

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

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

Back to the top