[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.technology.nebula] Re: Gantt: remove Connections

Hi Manuel,

Can you post or send me the NPE? I'm not suggesting connections should be 
disposed and re-set as that's not exactly intended behavor and I'm not all 
too surprised that there may be issues doing it that way, but I'd still like 
to see what the issue is :-)

As for what you're looking for, won't this ISetting give you what you want?
        /**
	 * Whether to only show the dependency connections only when an event is 
selected, as opposed to always showing the lines.
	 *
	 * @return true if to show them only on selections. Default is false.
	 */
	public boolean showOnlyDependenciesForSelectedItems();
Regards,
Emil


"Manuel Steurer" <manuel.steurer@xxxxxxxxxxxxxxx> wrote in message 
news:h1fuhh$689$1@xxxxxxxxxxxxxxxxxxxx
> Hi,
>
> I want to show specific connections when a user clicks on a GanttEvent.
> Of course I have to remove/hide the old ones, how can I do this? I tried
> disposing all connections, but this yields a NPE. I changed the source
> accordingly (set the GanttConnection's parent), but is there another
> way?
>
> this is what I do (essentially):
>
>
> Collection<GanttConnection> connections = new
> HashSet<GanttConnection>();
>
> connections.addAll(ganttChart.getGanttComposite().getGanttConnections())
> ;
> for (GanttConnection conn : connections)
> conn.dispose();
> ...
> n times:
> ganttChart.addConnection(parentEvent, childEvent);
>
>
> I I call this twice, I get an NPE at the conn.dispose() line
>
> Thanks,
> Manuel
>
> -- 
>