Search in sources :

Example 1 with ModeSupport

use of net.sourceforge.nattable.ui.mode.ModeSupport in project translationstudio8 by heartsome.

the class NatTable method initInternalListener.

protected void initInternalListener() {
    modeSupport = new ModeSupport(this);
    modeSupport.registerModeEventHandler(Mode.NORMAL_MODE, new ConfigurableModeEventHandler(modeSupport, this));
    modeSupport.switchMode(Mode.NORMAL_MODE);
    addPaintListener(this);
    addFocusListener(new FocusListener() {

        public void focusLost(final FocusEvent arg0) {
            redraw();
        }

        public void focusGained(final FocusEvent arg0) {
            redraw();
        }
    });
    addListener(SWT.Resize, new Listener() {

        public void handleEvent(final Event e) {
            doCommand(new ClientAreaResizeCommand(NatTable.this));
        }
    });
}
Also used : ModeSupport(net.sourceforge.nattable.ui.mode.ModeSupport) PaintListener(org.eclipse.swt.events.PaintListener) ILayerListener(net.sourceforge.nattable.layer.ILayerListener) FocusListener(org.eclipse.swt.events.FocusListener) Listener(org.eclipse.swt.widgets.Listener) ClientAreaResizeCommand(net.sourceforge.nattable.grid.command.ClientAreaResizeCommand) ConfigurableModeEventHandler(net.sourceforge.nattable.ui.mode.ConfigurableModeEventHandler) IVisualChangeEvent(net.sourceforge.nattable.layer.event.IVisualChangeEvent) FocusEvent(org.eclipse.swt.events.FocusEvent) Event(org.eclipse.swt.widgets.Event) PaintEvent(org.eclipse.swt.events.PaintEvent) ILayerEvent(net.sourceforge.nattable.layer.event.ILayerEvent) FocusListener(org.eclipse.swt.events.FocusListener) FocusEvent(org.eclipse.swt.events.FocusEvent)

Aggregations

ClientAreaResizeCommand (net.sourceforge.nattable.grid.command.ClientAreaResizeCommand)1 ILayerListener (net.sourceforge.nattable.layer.ILayerListener)1 ILayerEvent (net.sourceforge.nattable.layer.event.ILayerEvent)1 IVisualChangeEvent (net.sourceforge.nattable.layer.event.IVisualChangeEvent)1 ConfigurableModeEventHandler (net.sourceforge.nattable.ui.mode.ConfigurableModeEventHandler)1 ModeSupport (net.sourceforge.nattable.ui.mode.ModeSupport)1 FocusEvent (org.eclipse.swt.events.FocusEvent)1 FocusListener (org.eclipse.swt.events.FocusListener)1 PaintEvent (org.eclipse.swt.events.PaintEvent)1 PaintListener (org.eclipse.swt.events.PaintListener)1 Event (org.eclipse.swt.widgets.Event)1 Listener (org.eclipse.swt.widgets.Listener)1