Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Using Spring with XWT

Revision as of 05:10, 4 August 2010 by Unnamed Poltroon (Talk) (New page: == Introduction == == CLR Class == === CLR with x:Class === XWT file can be linked to a Java CLR (Common Language Runtime) class to manage for instance event handler of the UI with Jav...)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Introduction

CLR Class

CLR with x:Class

XWT file can be linked to a Java CLR (Common Language Runtime) class to manage for instance event handler of the UI with Java code by using x:Class attribute. The [#Event Handling] section give you a sample :

<Shell xmlns="http://www.eclipse.org/xwt/presentation"
    xmlns:x="http://www.eclipse.org/xwt"
    x:Class="ui.EventHandler">
    <Shell.layout>
       <GridLayout/>
    </Shell.layout>
    <Button text="Click Me!" SelectionEvent="clickButton">
    </Button>
</Shell>

which is linked to

package ui;
import org.eclipse.swt.Event;
import org.eclipse.swt.Button;
 
public class EventHandler {
    protected void clickButton(Event event) {
        Button button = (Button )event.widget;
        button.setText("Hello, world!");
    }
}

When the button gets selected, the method clickButton is invoked to change the Button text to "Hello, world!".

CLR with x:ClassFactory

org.eclipse.e4.xwt.springframework.AbstractSpringCLRFactory

CLR with x:ClassFactory & Spring

org.eclipse.e4.xwt.springframework.SpringCLRFactory

Using Spring with XWT

Using Spring Dynamic Module (OSGi) with XWT

Back to the top