Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 227780 | Differences between
and this patch

Collapse All | Expand All

(-)plugins/org.eclipse.dd.debug.memory.renderings.traditional/src/org/eclipse/dd/debug/memory/renderings/traditional/AbstractPane.java (-23 / +29 lines)
Lines 135-140 Link Here
135
        }
135
        }
136
    }
136
    }
137
    
137
    
138
    class AbstractPaneFocusListener implements FocusListener
139
    {
140
        public void focusLost(FocusEvent fe)
141
        {
142
        	IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
143
        	if(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE_ON_ENTER_ONLY
144
        			.equals(store.getString(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE)))
145
			{
146
        		fRendering.getViewportCache().clearEditBuffer(); 
147
			}
148
        	else
149
        	{
150
        		fRendering.getViewportCache().writeEditBuffer();
151
        	}
152
            
153
            // clear the pane local selection start
154
            AbstractPane.this.fSelectionStartAddress = null;
155
        }
156
157
        public void focusGained(FocusEvent fe)
158
        {
159
        }
160
    	
161
    }
138
    class AbstractPaneKeyListener implements KeyListener
162
    class AbstractPaneKeyListener implements KeyListener
139
    {
163
    {
140
        public void keyPressed(KeyEvent ke)
164
        public void keyPressed(KeyEvent ke)
Lines 272-300 Link Here
272
296
273
        this.addKeyListener(createKeyListener());
297
        this.addKeyListener(createKeyListener());
274
298
275
        this.addFocusListener(new FocusListener()
299
        this.addFocusListener(createFocusListener());
276
        {
277
            public void focusLost(FocusEvent fe)
278
            {
279
            	IPreferenceStore store = TraditionalRenderingPlugin.getDefault().getPreferenceStore();
280
            	if(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE_ON_ENTER_ONLY
281
            			.equals(store.getString(TraditionalRenderingPreferenceConstants.MEM_EDIT_BUFFER_SAVE)))
282
    			{
283
            		fRendering.getViewportCache().clearEditBuffer(); 
284
    			}
285
            	else
286
            	{
287
            		fRendering.getViewportCache().writeEditBuffer();
288
            	}
289
                
290
                // clear the pane local selection start
291
                AbstractPane.this.fSelectionStartAddress = null;
292
            }
293
294
            public void focusGained(FocusEvent fe)
295
            {
296
            }
297
        });
298
    }
300
    }
299
    
301
    
300
    protected MouseListener createMouseListener(){
302
    protected MouseListener createMouseListener(){
Lines 304-309 Link Here
304
    protected MouseMoveListener createMouseMoveListener(){
306
    protected MouseMoveListener createMouseMoveListener(){
305
    	return new AbstractPaneMouseMoveListener();
307
    	return new AbstractPaneMouseMoveListener();
306
    }
308
    }
309
    
310
    protected FocusListener createFocusListener() {
311
    	return new AbstractPaneFocusListener();
312
    }
307
313
308
    protected KeyListener createKeyListener(){
314
    protected KeyListener createKeyListener(){
309
    	return new AbstractPaneKeyListener();
315
    	return new AbstractPaneKeyListener();

Return to bug 227780