Correct reference to EPL in source headers
[egit/chris.git] / org.eclipse.egit.ui / src / org / eclipse / egit / ui / internal / components / ClickableCellEditor.java
blob3841268caf50136c1534544d0b0f81c19b984801
1 /*******************************************************************************
2 * Copyright (C) 2008, Marek Zawirski <marek.zawirski@gmail.com>
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
8 *******************************************************************************/
9 package org.eclipse.egit.ui.internal.components;
11 import org.eclipse.jface.viewers.CellEditor;
12 import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent;
13 import org.eclipse.swt.SWT;
14 import org.eclipse.swt.widgets.Composite;
15 import org.eclipse.swt.widgets.Control;
16 import org.eclipse.swt.widgets.Table;
18 /**
19 * Workaround class allowing usage of clickable element as a TableViewer cell,
20 * acting as button.
21 * <p>
22 * setValue method of EditingSupport is called on cell click, with this cell
23 * editor configured.
26 public class ClickableCellEditor extends CellEditor {
28 /**
29 * Create cell editor for provided table.
31 * @param table
32 * the parent table.
34 public ClickableCellEditor(final Table table) {
35 super(table, SWT.NONE);
38 @Override
39 protected Control createControl(Composite parent) {
40 return null;
43 @Override
44 protected Object doGetValue() {
45 return null;
48 @Override
49 protected void doSetFocus() {
50 // nothing to do
53 @Override
54 protected void doSetValue(Object value) {
55 // nothing to do
58 @Override
59 public void activate() {
60 // just force setValue on editing support
61 fireApplyEditorValue();
64 public void activate(ColumnViewerEditorActivationEvent activationEvent) {
65 if (activationEvent.eventType != ColumnViewerEditorActivationEvent.TRAVERSAL) {
66 super.activate(activationEvent);