Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #36751 > unrolled thread
| Started by | Eric Douglas <e.d.programmer@gmail.com> |
|---|---|
| First post | 2017-06-28 07:57 -0700 |
| Last post | 2017-07-02 11:56 -0400 |
| Articles | 2 on this page of 22 — 6 participants |
Back to article view | Back to comp.lang.java.programmer
Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-28 07:57 -0700
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-28 09:04 -0700
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-28 12:07 -0700
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-29 06:05 -0700
Re: Eclipse Jerry Stuckle <jstucklex@attglobal.net> - 2017-06-29 09:32 -0400
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-29 06:42 -0700
Re: Eclipse Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-29 09:47 -0400
Re: Eclipse Andreas Leitgeb <avl@logic.at> - 2017-06-30 14:47 +0000
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 08:22 -0700
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-07-07 06:19 -0700
Re: Eclipse Andreas Leitgeb <avl@logic.at> - 2017-07-13 09:29 +0000
Re: Eclipse Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-29 17:18 +0000
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-29 11:08 -0700
Re: Eclipse Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-29 18:58 +0000
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-29 12:55 -0700
Re: Eclipse Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-29 21:31 +0000
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-30 04:55 -0700
Re: Eclipse Martin Gregorie <martin@address-in-sig.invalid> - 2017-06-30 13:02 +0000
Re: Eclipse Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-29 16:34 -0400
Re: Eclipse Eric Douglas <e.d.programmer@gmail.com> - 2017-06-29 13:49 -0700
Re: Eclipse Eric Sosman <esosman@comcast-dot-net.invalid> - 2017-06-29 18:16 -0400
Re: Eclipse Arne Vajhøj <arne@vajhoej.dk> - 2017-07-02 11:56 -0400
Page 2 of 2 — ← Prev page 1 [2]
| From | Eric Sosman <esosman@comcast-dot-net.invalid> |
|---|---|
| Date | 2017-06-29 18:16 -0400 |
| Message-ID | <oj3u0u$rbc$1@dont-email.me> |
| In reply to | #36771 |
On 6/29/2017 4:49 PM, Eric Douglas wrote:
> On Thursday, June 29, 2017 at 4:34:59 PM UTC-4, Eric Sosman wrote:
>> The question I'd ask is: What does the Component's presence in (or
>> absence from) the List<MyCustomInterface> tell us? That is, what will
>> the code do differently if the answer is "Here!" rather than "Huh?"
>> And -- here's the nub -- could the different action be handled more
>> smoothly by overriding focusGained() and/or focusLost() in the
>> MyCustomInterface implementation?
>>
>> Maybe not, but that's the question I'd ask to start with.
>
> This component, which is checking for focusGains on this array of components, has it's own list of listeners. It is reporting a focusGain/focusLost event to those whenever one of these components gains or loses focus except if the focus came from one of these components and went to one of these components. This custom event needs to treat these components as a group.
My suggestion is to consider having the MyCustomInterface components
be their own FocusListeners instead of imposing the special treatment
"from the outside" as you seem to be doing now. That is, a "special"
component would register itself as its own focus listener, and when
receiving a FocusEvent it could check whether the partner is or is not
also a "special" component. The details depend on whether the special
treatment is applied to all MyCustomInterface implementations or only
to those on the list; you'd have either
if (partner instanceof MyCustomInterface) ...
or
if (partner instanceof MyCustomInterface
&& list.contains((MyCustomInterface) partner)) ...
If there's a good reason to handle FocusEvents externally to the
focused and unfocused components, well, fine: Just ignore my suggestion,
because I haven't had the reason explained to me.
> The only way I can see to get rid of the warning is to break it up to tell it they're components.
>
> myComponentArray.contains(focusComponent)
>
> becomes
>
> for (MyCustomInterface i : myComponentArray)
> if (((Component)i).equals(focusComponent)) {
> }
> }
Or cast focusComponent and use contains(), as above.
> I don't know any way to tell it for certain that yes any class which implements this interface does also extend Component.
I can't think of a way off-hand, either. (Elsethread you've already
rejected replacing MyCustomInterface with an abstract class that extends
Component.) But even if you think of a way, it wouldn't help. Your
problem is not that a MyCustomInterface implementation might not be a
Component, but that an unadorned Component (which is what the FocusEvent
gives you) might not implement MyCustomInterface.
--
esosman@comcast-dot-net.invalid
Thirteen hundred one days to go.
[toc] | [prev] | [next] | [standalone]
| From | Arne Vajhøj <arne@vajhoej.dk> |
|---|---|
| Date | 2017-07-02 11:56 -0400 |
| Message-ID | <ojb52o$11t1$1@gioia.aioe.org> |
| In reply to | #36751 |
On 6/28/2017 10:57 AM, Eric Douglas wrote: > Am I doing something wrong? I download the Eclipse Oxygen installer > and I point it to the same folder where I have Eclipse Neon installed > because I don't want to lose any preferences. It says it installed, > then it starts and I go to help about and it still shows Neon. I have never had any problems: * downloading new version zip * unzip in temp dir * rename old eclipse dir * move new dir into place where old dir was * edit ini file to give more memory * open * point to right workspace * install the plugins I need (very few) * restart Arne
[toc] | [prev] | [standalone]
Page 2 of 2 — ← Prev page 1 [2]
Back to top | Article view | comp.lang.java.programmer
csiph-web