Skip to content
Snippets Groups Projects
Commit a45052ed authored by Vincent Aravantinos's avatar Vincent Aravantinos
Browse files

improvement

refs 1960
parent 12af24ba
No related branches found
No related tags found
No related merge requests found
Showing
with 27 additions and 58 deletions
......@@ -33,6 +33,8 @@ import org.eclipse.swt.widgets.Composite;
import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
/**
* TODO(VA): Comment?
* TODO(VA): This class should be factorized with AbstractTextCellDatabindingEditingSupport
*
* @author czhang
* @author $Author: hoelzl $
......@@ -50,11 +52,10 @@ public abstract class AbstractComplexCellDatabindingEditingSupport extends Editi
/**
* Complex data bindings.
*
* @see DataBindingUtils#performComplexTextBinding(DataBindingContext,
* @see DataBindingUtils#performCellTextBinding(DataBindingContext,
* org.eclipse.swt.widgets.Control, IObservableValue,
* org.eclipse.core.databinding.conversion.IConverter,
* org.eclipse.core.databinding.conversion.IConverter,
* org.eclipse.core.databinding.validation.IValidator,
* org.eclipse.core.databinding.validation.IValidator)
*/
private Binding[] bindings;
......@@ -66,9 +67,7 @@ public abstract class AbstractComplexCellDatabindingEditingSupport extends Editi
private final ColumnViewerEditorActivationListenerHelper activationListener =
new ColumnViewerEditorActivationListenerHelper();
/**
* @param viewer
*/
/** Constructor. */
public AbstractComplexCellDatabindingEditingSupport(ColumnViewer viewer,
DataBindingContext bindingContext) {
super(viewer);
......@@ -82,12 +81,12 @@ public abstract class AbstractComplexCellDatabindingEditingSupport extends Editi
return cellEditor;
}
/** Override this method to create another cell editor. */
abstract protected CellEditor createComplexCellEditor(ColumnViewer viewer, Object model);
/** Set up the new created {@link CellEditor} */
protected abstract void setupCellEditor(CellEditor cellEditor);
/** Override this method to create another cell editor. */
abstract protected CellEditor createComplexCellEditor(ColumnViewer viewer, Object model);
/** Set up dialog cell editor */
protected abstract boolean isComplexCellEditor(Object model);
......
......@@ -26,6 +26,8 @@ import org.fortiss.tooling.base.ui.editor.TextCellEditorWithTextStyledTextAction
import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
/**
* TODO(VA): Comment?
* TODO(VA): Many similarities with AbstractTextCellWithTextStyledblah, should be factorized.
*
* @author czhang
* @author $Author: hoelzl $
......
......@@ -18,7 +18,7 @@ $Id: codetemplates.xml 1 2011-01-01 00:00:01Z hoelzl $
package org.fortiss.tooling.base.ui.databinding;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.DECORATION_KEY;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performComplexTextBinding;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performCellTextBinding;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
......@@ -35,6 +35,9 @@ import org.eclipse.swt.widgets.Text;
import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
/**
* TODO(VA): Comment?
* TODO(VA): Many similarities with AbstractDecoratedTextCellWithTextStyledblah, should be
* factorized.
*
* @author czhang
* @author $Author: hoelzl $
......@@ -65,10 +68,9 @@ public abstract class AbstractDecoratedComplexCellWithTextStyledTextActionHandle
@Override
protected Binding[] createBinding(CellEditor cellEditor, ViewerCell cell, CellEditor editor,
DataBindingContext context) {
return performComplexTextBinding(dbc, getText(cellEditor),
return performCellTextBinding(dbc, getText(cellEditor),
getModelObservableValue(cell.getElement()), getModelToTextConverter(),
getTextToModelConverter(), getTextValidator(cell.getElement()),
getTextPostConvertValidator());
getTextToModelConverter(), getTextValidator(cell.getElement()));
}
/** Sub-classes need to provide an {@link IObservableValue} for the model. */
......@@ -95,15 +97,4 @@ public abstract class AbstractDecoratedComplexCellWithTextStyledTextActionHandle
protected IValidator getTextValidator(Object object) {
return null;
}
/**
* Sub-classes should overwrite to provide a {@link IValidator} for the
* conversion result.
*
* @return <code>null</code>, by default
*/
protected IValidator getTextPostConvertValidator() {
return null;
}
}
......@@ -18,6 +18,7 @@ $Id$
package org.fortiss.tooling.base.ui.databinding;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.DECORATION_KEY;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performCellTextBinding;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
......@@ -42,7 +43,7 @@ import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: 8F63266BE29B322373F9859F423C6D01
* @ConQAT.Rating YELLOW Hash: 3762F1DC6ABDD2856F4DBEB4BB0E9B57
*/
public abstract class AbstractDecoratedTextCellDatabindingEditingSupport extends
AbstractTextCellDatabindingEditingSupport {
......@@ -64,10 +65,9 @@ public abstract class AbstractDecoratedTextCellDatabindingEditingSupport extends
@Override
protected Binding[] createBinding(CellEditor cellEditor, ViewerCell cell, CellEditor editor,
DataBindingContext context) {
return DataBindingUtils.performComplexTextBinding(dbc, cellEditor.getControl(),
return performCellTextBinding(dbc, cellEditor.getControl(),
getModelObservableValue(cell.getElement()), getModelToTextConverter(),
getTextToModelConverter(), getTextValidator(cell.getElement()),
getTextPostConvertValidator());
getTextToModelConverter(), getTextValidator(cell.getElement()));
}
/** Sub-classes need to provide an {@link IObservableValue} for the model. */
......@@ -94,14 +94,4 @@ public abstract class AbstractDecoratedTextCellDatabindingEditingSupport extends
protected IValidator getTextValidator(Object object) {
return null;
}
/**
* Sub-classes should overwrite to provide a {@link IValidator} for the
* conversion result.
*
* @return <code>null</code>, by default
*/
protected IValidator getTextPostConvertValidator() {
return null;
}
}
......@@ -18,7 +18,7 @@ $Id: AbstractDecoratedTextCellDatabindingEditingSupport.java 5274 2012-08-02 07:
package org.fortiss.tooling.base.ui.databinding;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.DECORATION_KEY;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performComplexTextBinding;
import static org.fortiss.tooling.kernel.ui.util.DataBindingUtils.performCellTextBinding;
import org.eclipse.core.databinding.Binding;
import org.eclipse.core.databinding.DataBindingContext;
......@@ -45,7 +45,7 @@ import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
* @author hoelzl
* @author $Author: mou $
* @version $Rev: 5274 $
* @ConQAT.Rating GREEN Hash: 48D099EDAF1D7F6E29025C47AC47DA07
* @ConQAT.Rating YELLOW Hash: BA83049008795857F9D86E60CDF1129E
*/
public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport
extends AbstractTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport {
......@@ -55,7 +55,6 @@ public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDa
EditorBase<? extends EObject> editor, ColumnViewer viewer,
DataBindingContext bindingContext) {
super(editor, viewer, bindingContext);
}
/** {@inheritDoc} */
......@@ -69,10 +68,9 @@ public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDa
@Override
protected Binding[] createBinding(CellEditor cellEditor, ViewerCell cell, CellEditor editor,
DataBindingContext context) {
return performComplexTextBinding(dbc, cellEditor.getControl(),
return performCellTextBinding(dbc, cellEditor.getControl(),
getModelObservableValue(cell.getElement()), getModelToTextConverter(),
getTextToModelConverter(), getTextValidator(cell.getElement()),
getTextPostConvertValidator());
getTextToModelConverter(), getTextValidator(cell.getElement()));
}
/** Sub-classes need to provide an {@link IObservableValue} for the model. */
......@@ -99,14 +97,4 @@ public abstract class AbstractDecoratedTextCellWithTextStyledTextActionHandlerDa
protected IValidator getTextValidator(Object object) {
return null;
}
/**
* Sub-classes should overwrite to provide a {@link IValidator} for the
* conversion result.
*
* @return <code>null</code>, by default
*/
protected IValidator getTextPostConvertValidator() {
return null;
}
}
......@@ -38,7 +38,7 @@ import org.fortiss.tooling.kernel.ui.util.DataBindingUtils;
* @author hoelzl
* @author $Author$
* @version $Rev$
* @ConQAT.Rating GREEN Hash: E0D2AF019F25B1ABA2CE73845002648E
* @ConQAT.Rating YELLOW Hash: D2BFE907FCC15A418E3B460942D66D89
*/
public abstract class AbstractTextCellDatabindingEditingSupport extends EditingSupport {
......@@ -51,11 +51,10 @@ public abstract class AbstractTextCellDatabindingEditingSupport extends EditingS
/**
* Complex data bindings.
*
* @see DataBindingUtils#performComplexTextBinding(DataBindingContext,
* @see DataBindingUtils#performCellTextBinding(DataBindingContext,
* org.eclipse.swt.widgets.Control, IObservableValue,
* org.eclipse.core.databinding.conversion.IConverter,
* org.eclipse.core.databinding.conversion.IConverter,
* org.eclipse.core.databinding.validation.IValidator,
* org.eclipse.core.databinding.validation.IValidator)
*/
private Binding[] bindings;
......
......@@ -26,12 +26,12 @@ import org.fortiss.tooling.base.ui.editor.TextCellEditorWithTextStyledTextAction
import org.fortiss.tooling.kernel.ui.extension.base.EditorBase;
/**
* Abstract base class for inline text cell editors using data binding.
* Abstract base class for inline text cell, with copy-pasting.
*
* @author hoelzl
* @author $Author: mou $
* @version $Rev: 5274 $
* @ConQAT.Rating GREEN Hash: 2024303706A42F32A4DFD3517A7A59C4
* @ConQAT.Rating YELLOW Hash: 2AC0841B257BCC2D137D578D5CC85B15
*/
public abstract class AbstractTextCellWithTextStyledTextActionHandlerDatabindingEditingSupport
extends AbstractTextCellDatabindingEditingSupport {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment