<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="it">
	<id>http://wiki.netsitech.com/index.php?action=history&amp;feed=atom&amp;title=Programmazione%3AJava%2FEclipse_RCP%2FEvent_Interface_implementation</id>
	<title>Programmazione:Java/Eclipse RCP/Event Interface implementation - Cronologia</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.netsitech.com/index.php?action=history&amp;feed=atom&amp;title=Programmazione%3AJava%2FEclipse_RCP%2FEvent_Interface_implementation"/>
	<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;action=history"/>
	<updated>2026-05-04T10:44:49Z</updated>
	<subtitle>Cronologia della pagina su questo sito</subtitle>
	<generator>MediaWiki 1.34.4</generator>
	<entry>
		<id>http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2773&amp;oldid=prev</id>
		<title>Rimondini il 08:28, 14 apr 2008</title>
		<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2773&amp;oldid=prev"/>
		<updated>2008-04-14T08:28:33Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 08:28, 14 apr 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l1&quot; &gt;Riga 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Riga 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Programmazione:Java/Eclipse_RCP|&amp;lt;&amp;lt; Back to Eclipse RCP]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=How to implement Event Interface=&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=How to implement Event Interface=&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Rimondini</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2678&amp;oldid=prev</id>
		<title>Rimondini: ha spostato Programmazione:Java/Event Interface implementation a Programmazione:Java/Eclipse RCP/Event Interface implementation</title>
		<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2678&amp;oldid=prev"/>
		<updated>2008-04-14T08:06:44Z</updated>

		<summary type="html">&lt;p&gt;ha spostato &lt;a href=&quot;/index.php/Programmazione:Java/Event_Interface_implementation&quot; class=&quot;mw-redirect&quot; title=&quot;Programmazione:Java/Event Interface implementation&quot;&gt;Programmazione:Java/Event Interface implementation&lt;/a&gt; a &lt;a href=&quot;/index.php/Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&quot; title=&quot;Programmazione:Java/Eclipse RCP/Event Interface implementation&quot;&gt;Programmazione:Java/Eclipse RCP/Event Interface implementation&lt;/a&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;it&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Versione meno recente&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Versione delle 08:06, 14 apr 2008&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;it&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(Nessuna differenza)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Rimondini</name></author>
		
	</entry>
	<entry>
		<id>http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2121&amp;oldid=prev</id>
		<title>Rimondini il 11:56, 31 ott 2007</title>
		<link rel="alternate" type="text/html" href="http://wiki.netsitech.com/index.php?title=Programmazione:Java/Eclipse_RCP/Event_Interface_implementation&amp;diff=2121&amp;oldid=prev"/>
		<updated>2007-10-31T11:56:14Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Nuova pagina&lt;/b&gt;&lt;/p&gt;&lt;div&gt;=How to implement Event Interface=&lt;br /&gt;
&lt;br /&gt;
This article use '''org.eclipse.swt.widgets.Listener''' interface as example....but it's valid for all interface&lt;br /&gt;
&lt;br /&gt;
==Bad Practice==&lt;br /&gt;
&amp;lt;code java&amp;gt;&lt;br /&gt;
public class TestEventImpl {&lt;br /&gt;
   Shell shell;&lt;br /&gt;
   Button bt;&lt;br /&gt;
&lt;br /&gt;
   public void create() {&lt;br /&gt;
      shell = new Shell(PlatformUI.getWorkbench().getDisplay());&lt;br /&gt;
      &lt;br /&gt;
      Composite c = new Composite(shell, SWT.BORDER);&lt;br /&gt;
	&lt;br /&gt;
      bt = new Button(c, SWT.PUSH);&lt;br /&gt;
      bt.setText(&amp;quot;Push ME&amp;quot;);&lt;br /&gt;
      bt.addListener(SWT.Selection, new Listener() {&lt;br /&gt;
         public void handleEvent(Event event) {&lt;br /&gt;
            // Do something&lt;br /&gt;
         }&lt;br /&gt;
      });&lt;br /&gt;
	&lt;br /&gt;
      shell.addListener(SWT.Dispose, new Listener() {&lt;br /&gt;
         public void handleEvent(Event event) {&lt;br /&gt;
            // I can't remove listener...I don't have reference....&lt;br /&gt;
         }&lt;br /&gt;
      });&lt;br /&gt;
      shell.open();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Not Bad Practice but...==&lt;br /&gt;
&amp;lt;code java&amp;gt;&lt;br /&gt;
public class TestEventImpl {&lt;br /&gt;
   Listener bt_listener, shell_listener;&lt;br /&gt;
   Shell shell;&lt;br /&gt;
   Button bt;&lt;br /&gt;
&lt;br /&gt;
   public void create() {&lt;br /&gt;
      shell = new Shell(PlatformUI.getWorkbench().getDisplay());&lt;br /&gt;
      &lt;br /&gt;
      Composite c = new Composite(shell, SWT.BORDER);&lt;br /&gt;
	&lt;br /&gt;
      bt = new Button(c, SWT.PUSH);&lt;br /&gt;
      bt.setText(&amp;quot;Push ME&amp;quot;);&lt;br /&gt;
      bt_listener = new Listener() {&lt;br /&gt;
         public void handleEvent(Event event) {&lt;br /&gt;
            // Do something&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
      bt.addListener(SWT.Selection, bt_listener);&lt;br /&gt;
		&lt;br /&gt;
      shell_listener = new Listener() {&lt;br /&gt;
         public void handleEvent(Event event) {&lt;br /&gt;
            TestEventImpl parent = (TestEventImpl)event.widget.getData(&amp;quot;ClassParent&amp;quot;);&lt;br /&gt;
            parent.bt.removeListener(bt_listener);&lt;br /&gt;
            parent.shell.removeListener(shell_listener);&lt;br /&gt;
         }&lt;br /&gt;
      }&lt;br /&gt;
      shell.addListener(SWT.Dispose, shell_listener);&lt;br /&gt;
      shell.setData(&amp;quot;ClassParent&amp;quot;, this); // must save a class reference&lt;br /&gt;
      shell.open();&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Best Practice ==&lt;br /&gt;
&amp;lt;code java&amp;gt;&lt;br /&gt;
public class TestEventImpl implements Listener {&lt;br /&gt;
   Shell shell;&lt;br /&gt;
   Button bt;&lt;br /&gt;
&lt;br /&gt;
   public void create() {&lt;br /&gt;
      shell = new Shell(PlatformUI.getWorkbench().getDisplay());&lt;br /&gt;
&lt;br /&gt;
      Composite c = new Composite(shell, SWT.BORDER);&lt;br /&gt;
&lt;br /&gt;
      bt = new Button(c, SWT.PUSH);&lt;br /&gt;
      bt.setText(&amp;quot;Push ME&amp;quot;);&lt;br /&gt;
      bt.addListener(SWT.Selection, this);&lt;br /&gt;
&lt;br /&gt;
      shell.addListener(SWT.Dispose, this);&lt;br /&gt;
      shell.open();&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
   public void handleEvent(Event event) {&lt;br /&gt;
      switch(event.type) {&lt;br /&gt;
         case SWT.Selection: &lt;br /&gt;
            if(event.widget == bt) {&lt;br /&gt;
               // Do something&lt;br /&gt;
            }&lt;br /&gt;
         break;&lt;br /&gt;
         case SWT.Dispose: &lt;br /&gt;
            if(event.widget == shell) {&lt;br /&gt;
               bt.removeListener(this);&lt;br /&gt;
               shell.removeListener(this);&lt;br /&gt;
            }&lt;br /&gt;
         break;&lt;br /&gt;
      }&lt;br /&gt;
   }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rimondini</name></author>
		
	</entry>
</feed>