Home » Eclipse Projects » Eclipse Platform » Extending Folder resource
Extending Folder resource [message #325568] |
Fri, 22 February 2008 04:37  |
Eclipse User |
|
|
|
Hi,
I want to extend the org.eclipse.core.internal.resources.Folder to create my
own type of a Folder and add to the behavior and some of my own
manipulations. When I try to directly extend it, the constructor returns a
ClassCastException. Even if I try to cast a folder object to my own custom
folder, I get the same ClassCastException.
We cannot extend classes defined under org.eclipse.core.internal.resources,
is it? Would you suggest on how to try to the same! :-)
Thanks.
|
|
| | |
Re: Extending Folder resource [message #325633 is a reply to message #325608] |
Sun, 24 February 2008 04:26   |
Eclipse User |
|
|
|
Hi Eric and Ed!
Thanks a lot for the prompt responses. From what I did read around, I felt
you cannot pretty much extend the internal classes but I wanted to reconfirm
from someone.. So thanks for that... Eric I am looking at basically holding
a custom object/handle associated with each folder falling under a certain
group of special folders I have defined under a project.. So for this, one
of the approach was to make my custom class extend the folder and then add
some of my own behaviorial methods to it.. This way I would be able to keep
it all under a single object, my stuff + folder representation..
Am not sure how I would be able to do something similar via extension
points... Any direction there would be great! But thanks a lot for the
replies anyway...
Thanks,
Rahul
"Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
news:fpnpe1$hj5$3@build.eclipse.org...
> Rahul Kamdar wrote:
>> Hi,
>>
>> I want to extend the org.eclipse.core.internal.resources.Folder to create
>> my own type of a Folder and add to the behavior and some of my own
>> manipulations. When I try to directly extend it, the constructor returns
>> a ClassCastException. Even if I try to cast a folder object to my own
>> custom folder, I get the same ClassCastException.
>>
>> We cannot extend classes defined under
>> org.eclipse.core.internal.resources, is it? Would you suggest on how to
>> try to the same! :-)
>
> As Ed already said, its futile to try to extend internal classes.
> What behavior, specifially, are you wanting to add? Many things can be
> done via extension points.
>
> Eric
|
|
|
Re: Extending Folder resource [message #325635 is a reply to message #325633] |
Sun, 24 February 2008 08:16   |
Eclipse User |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------070409010403050104040102
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Rahul,
I imagine this could be done via a registered IAdapterFactory; an
IResource is an IAdaptable. You could exploit
IResource.getPersistenceProperty/setPersistenProperty to help implement
your adapter.
Rahul Kamdar wrote:
> Hi Eric and Ed!
>
> Thanks a lot for the prompt responses. From what I did read around, I felt
> you cannot pretty much extend the internal classes but I wanted to reconfirm
> from someone.. So thanks for that... Eric I am looking at basically holding
> a custom object/handle associated with each folder falling under a certain
> group of special folders I have defined under a project.. So for this, one
> of the approach was to make my custom class extend the folder and then add
> some of my own behaviorial methods to it.. This way I would be able to keep
> it all under a single object, my stuff + folder representation..
>
> Am not sure how I would be able to do something similar via extension
> points... Any direction there would be great! But thanks a lot for the
> replies anyway...
>
> Thanks,
>
> Rahul
>
> "Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message
> news:fpnpe1$hj5$3@build.eclipse.org...
>
>> Rahul Kamdar wrote:
>>
>>> Hi,
>>>
>>> I want to extend the org.eclipse.core.internal.resources.Folder to create
>>> my own type of a Folder and add to the behavior and some of my own
>>> manipulations. When I try to directly extend it, the constructor returns
>>> a ClassCastException. Even if I try to cast a folder object to my own
>>> custom folder, I get the same ClassCastException.
>>>
>>> We cannot extend classes defined under
>>> org.eclipse.core.internal.resources, is it? Would you suggest on how to
>>> try to the same! :-)
>>>
>> As Ed already said, its futile to try to extend internal classes.
>> What behavior, specifially, are you wanting to add? Many things can be
>> done via extension points.
>>
>> Eric
>>
>
>
>
--------------070409010403050104040102
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Rahul,<br>
<br>
I imagine this could be done via a registered IAdapterFactory; an
IResource is an IAdaptable. You could exploit
IResource.getPersistenceProperty/setPersistenProperty to help implement
your adapter.<br>
<br>
<br>
Rahul Kamdar wrote:
<blockquote cite="mid:fprd8r$53u$1@build.eclipse.org" type="cite">
<pre wrap="">Hi Eric and Ed!
Thanks a lot for the prompt responses. From what I did read around, I felt
you cannot pretty much extend the internal classes but I wanted to reconfirm
from someone.. So thanks for that... Eric I am looking at basically holding
a custom object/handle associated with each folder falling under a certain
group of special folders I have defined under a project.. So for this, one
of the approach was to make my custom class extend the folder and then add
some of my own behaviorial methods to it.. This way I would be able to keep
it all under a single object, my stuff + folder representation..
Am not sure how I would be able to do something similar via extension
points... Any direction there would be great! But thanks a lot for the
replies anyway...
Thanks,
Rahul
"Eric Rizzo" <a class="moz-txt-link-rfc2396E" href="mailto:eclipse-news@rizzoweb.com"><eclipse-news@rizzoweb.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:fpnpe1$hj5$3@build.eclipse.org">news:fpnpe1$hj5$3@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Rahul Kamdar wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I want to extend the org.eclipse.core.internal.resources.Folder to create
my own type of a Folder and add to the behavior and some of my own
manipulations. When I try to directly extend it, the constructor returns
a ClassCastException. Even if I try to cast a folder object to my own
custom folder, I get the same ClassCastException.
We cannot extend classes defined under
org.eclipse.core.internal.resources, is it? Would you suggest on how to
try to the same! :-)
</pre>
</blockquote>
<pre wrap="">As Ed already said, its futile to try to extend internal classes.
What behavior, specifially, are you wanting to add? Many things can be
done via extension points.
Eric
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
<br>
</body>
</html>
--------------070409010403050104040102--
|
|
|
Re: Extending Folder resource [message #325637 is a reply to message #325635] |
Sun, 24 February 2008 12:37  |
Eclipse User |
|
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_001F_01C8773A.0B212830
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Ed,
Thanks again for the quick help... I think the IAdaptorFactory should do =
just the work I need... I'll check up and get back if I need some =
help/pointers!! Thanks a lot!
Rahul
"Ed Merks" <merks@ca.ibm.com> wrote in message =
news:fprqnd$nit$1@build.eclipse.org...
Rahul,
I imagine this could be done via a registered IAdapterFactory; an =
IResource is an IAdaptable. You could exploit =
IResource.getPersistenceProperty/setPersistenProperty to help implement =
your adapter.
Rahul Kamdar wrote:=20
Hi Eric and Ed!
Thanks a lot for the prompt responses. From what I did read around, I =
felt=20
you cannot pretty much extend the internal classes but I wanted to =
reconfirm=20
from someone.. So thanks for that... Eric I am looking at basically =
holding=20
a custom object/handle associated with each folder falling under a =
certain=20
group of special folders I have defined under a project.. So for this, =
one=20
of the approach was to make my custom class extend the folder and then =
add=20
some of my own behaviorial methods to it.. This way I would be able to =
keep=20
it all under a single object, my stuff + folder representation..
Am not sure how I would be able to do something similar via extension=20
points... Any direction there would be great! But thanks a lot for the=20
replies anyway...
Thanks,
Rahul
"Eric Rizzo" <eclipse-news@rizzoweb.com> wrote in message=20
news:fpnpe1$hj5$3@build.eclipse.org...
Rahul Kamdar wrote:
Hi,
I want to extend the org.eclipse.core.internal.resources.Folder to =
create=20
my own type of a Folder and add to the behavior and some of my own=20
manipulations. When I try to directly extend it, the constructor returns =
a ClassCastException. Even if I try to cast a folder object to my own=20
custom folder, I get the same ClassCastException.
We cannot extend classes defined under=20
org.eclipse.core.internal.resources, is it? Would you suggest on how to=20
try to the same! :-)
As Ed already said, its futile to try to extend internal classes.
What behavior, specifially, are you wanting to add? Many things can be=20
done via extension points.
Eric=20
=20
=20
------=_NextPart_000_001F_01C8773A.0B212830
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type =
content=3Dtext/html;charset=3DISO-8859-1>
<META content=3D"MSHTML 6.00.6000.16525" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY text=3D#000000 bgColor=3D#ffffff>
<DIV><FONT face=3DArial size=3D2>Hi Ed,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Thanks again for the quick help... I =
think the=20
IAdaptorFactory should do just the work I need... I'll check up and get =
back if=20
I need some help/pointers!! Thanks a lot!</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>Rahul</FONT></DIV>
<BLOCKQUOTE=20
style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; =
BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
<DIV>"Ed Merks" <<A =
href=3D"mailto:merks@ca.ibm.com">merks@ca.ibm.com</A>>=20
wrote in message <A=20
=
href=3D"news:fprqnd$nit$1@build.eclipse.org">news:fprqnd$nit$1@build.ecli=
pse.org</A>...</DIV>Rahul,<BR><BR>I=20
imagine this could be done via a registered IAdapterFactory; an =
IResource is=20
an IAdaptable. You could exploit=20
IResource.getPersistenceProperty/setPersistenProperty to help =
implement your=20
adapter.<BR><BR><BR>Rahul Kamdar wrote:=20
<BLOCKQUOTE cite=3Dmid:fprd8r$53u$1@build.eclipse.org =
type=3D"cite"><PRE wrap=3D"">Hi Eric and Ed!
Thanks a lot for the prompt responses. From what I did read around, I =
felt=20
you cannot pretty much extend the internal classes but I wanted to =
reconfirm=20
from someone.. So thanks for that... Eric I am looking at basically =
holding=20
a custom object/handle associated with each folder falling under a =
certain=20
group of special folders I have defined under a project.. So for this, =
one=20
of the approach was to make my custom class extend the folder and then =
add=20
some of my own behaviorial methods to it.. This way I would be able to =
keep=20
it all under a single object, my stuff + folder representation..
Am not sure how I would be able to do something similar via extension=20
points... Any direction there would be great! But thanks a lot for the=20
replies anyway...
Thanks,
Rahul
"Eric Rizzo" <A class=3Dmoz-txt-link-rfc2396E =
href=3D"mailto:eclipse-news@rizzoweb.com"><eclipse-news@rizzoweb.com&g=
t;</A> wrote in message=20
<A class=3Dmoz-txt-link-freetext =
href=3D"news:fpnpe1$hj5$3@build.eclipse.org">news:fpnpe1$hj5$3@build.ecli=
pse.org</A>...
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Rahul Kamdar wrote:
</PRE>
<BLOCKQUOTE type=3D"cite"><PRE wrap=3D"">Hi,
I want to extend the org.eclipse.core.internal.resources.Folder to =
create=20
my own type of a Folder and add to the behavior and some of my own=20
manipulations. When I try to directly extend it, the constructor returns =
a ClassCastException. Even if I try to cast a folder object to my own=20
custom folder, I get the same ClassCastException.
We cannot extend classes defined under=20
org.eclipse.core.internal.resources, is it? Would you suggest on how to=20
try to the same! :-)
</PRE></BLOCKQUOTE><PRE wrap=3D"">As Ed already said, its futile =
to try to extend internal classes.
What behavior, specifially, are you wanting to add? Many things can be=20
done via extension points.
Eric=20
</PRE></BLOCKQUOTE><PRE wrap=3D""><!---->
</PRE></BLOCKQUOTE><BR></BLOCKQUOTE></BODY></HTML>
------=_NextPart_000_001F_01C8773A.0B212830--
|
|
|
Goto Forum:
Current Time: Sat Jun 07 05:50:52 EDT 2025
Powered by FUDForum. Page generated in 0.03134 seconds
|