Search in sources :

Example 1 with ICellEditorValidator

use of org.eclipse.jface.viewers.ICellEditorValidator in project tdi-studio-se by Talend.

the class ListBusinessItemNameEditPart method getEditTextValidator.

/**
     * @generated
     */
public ICellEditorValidator getEditTextValidator() {
    return new ICellEditorValidator() {

        public String isValid(final Object value) {
            if (value instanceof String) {
                final EObject element = getParserElement();
                final IParser parser = getParser();
                try {
                    IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {

                        public void run() {
                            setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
                        }
                    });
                    return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
                } catch (InterruptedException ie) {
                    // ie.printStackTrace();
                    ExceptionHandler.process(ie);
                }
            }
            // shouldn't get here
            return null;
        }
    };
}
Also used : ICellEditorValidator(org.eclipse.jface.viewers.ICellEditorValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) IParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser)

Example 2 with ICellEditorValidator

use of org.eclipse.jface.viewers.ICellEditorValidator in project tdi-studio-se by Talend.

the class ActionBusinessItemNameEditPart method getEditTextValidator.

/**
     * @generated
     */
public ICellEditorValidator getEditTextValidator() {
    return new ICellEditorValidator() {

        public String isValid(final Object value) {
            if (value instanceof String) {
                final EObject element = getParserElement();
                final IParser parser = getParser();
                try {
                    IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {

                        public void run() {
                            setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
                        }
                    });
                    return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
                } catch (InterruptedException ie) {
                    // ie.printStackTrace();
                    ExceptionHandler.process(ie);
                }
            }
            // shouldn't get here
            return null;
        }
    };
}
Also used : ICellEditorValidator(org.eclipse.jface.viewers.ICellEditorValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) IParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser)

Example 3 with ICellEditorValidator

use of org.eclipse.jface.viewers.ICellEditorValidator in project tdi-studio-se by Talend.

the class BidirectionalBusinessItemRelationshipNameEditPart method getEditTextValidator.

/**
     * @generated
     */
public ICellEditorValidator getEditTextValidator() {
    return new ICellEditorValidator() {

        public String isValid(final Object value) {
            if (value instanceof String) {
                final EObject element = getParserElement();
                final IParser parser = getParser();
                try {
                    IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {

                        public void run() {
                            setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
                        }
                    });
                    return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
                } catch (InterruptedException ie) {
                    // ie.printStackTrace();
                    ExceptionHandler.process(ie);
                }
            }
            // shouldn't get here
            return null;
        }
    };
}
Also used : ICellEditorValidator(org.eclipse.jface.viewers.ICellEditorValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) IParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser)

Example 4 with ICellEditorValidator

use of org.eclipse.jface.viewers.ICellEditorValidator in project tdi-studio-se by Talend.

the class DecisionBusinessItemNameEditPart method getEditTextValidator.

/**
     * @generated
     */
public ICellEditorValidator getEditTextValidator() {
    return new ICellEditorValidator() {

        public String isValid(final Object value) {
            if (value instanceof String) {
                final EObject element = getParserElement();
                final IParser parser = getParser();
                try {
                    IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {

                        public void run() {
                            setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
                        }
                    });
                    return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
                } catch (InterruptedException e) {
                    // ie.printStackTrace();
                    ExceptionHandler.process(e);
                }
            }
            // shouldn't get here
            return null;
        }
    };
}
Also used : ICellEditorValidator(org.eclipse.jface.viewers.ICellEditorValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) IParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser)

Example 5 with ICellEditorValidator

use of org.eclipse.jface.viewers.ICellEditorValidator in project tdi-studio-se by Talend.

the class TerminalBusinessItemNameEditPart method getEditTextValidator.

/**
     * @generated
     */
public ICellEditorValidator getEditTextValidator() {
    return new ICellEditorValidator() {

        public String isValid(final Object value) {
            if (value instanceof String) {
                final EObject element = getParserElement();
                final IParser parser = getParser();
                try {
                    IParserEditStatus valid = (IParserEditStatus) getEditingDomain().runExclusive(new RunnableWithResult.Impl() {

                        public void run() {
                            setResult(parser.isValidEditString(new EObjectAdapter(element), (String) value));
                        }
                    });
                    return valid.getCode() == ParserEditStatus.EDITABLE ? null : valid.getMessage();
                } catch (InterruptedException ie) {
                    // ie.printStackTrace();
                    ExceptionHandler.process(ie);
                }
            }
            // shouldn't get here
            return null;
        }
    };
}
Also used : ICellEditorValidator(org.eclipse.jface.viewers.ICellEditorValidator) EObject(org.eclipse.emf.ecore.EObject) EObject(org.eclipse.emf.ecore.EObject) IParserEditStatus(org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus) EObjectAdapter(org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter) IParser(org.eclipse.gmf.runtime.common.ui.services.parser.IParser)

Aggregations

ICellEditorValidator (org.eclipse.jface.viewers.ICellEditorValidator)20 EObject (org.eclipse.emf.ecore.EObject)14 IParser (org.eclipse.gmf.runtime.common.ui.services.parser.IParser)14 IParserEditStatus (org.eclipse.gmf.runtime.common.ui.services.parser.IParserEditStatus)14 EObjectAdapter (org.eclipse.gmf.runtime.emf.core.util.EObjectAdapter)14 TextCellEditor (org.eclipse.jface.viewers.TextCellEditor)4 CellEditor (org.eclipse.jface.viewers.CellEditor)3 Composite (org.eclipse.swt.widgets.Composite)3 Label (org.eclipse.swt.widgets.Label)3 EditingSupport (org.eclipse.jface.viewers.EditingSupport)2 ICellEditorListener (org.eclipse.jface.viewers.ICellEditorListener)2 TreeViewerColumn (org.eclipse.jface.viewers.TreeViewerColumn)2 SelectionAdapter (org.eclipse.swt.events.SelectionAdapter)2 SelectionEvent (org.eclipse.swt.events.SelectionEvent)2 Font (org.eclipse.swt.graphics.Font)2 GridLayout (org.eclipse.swt.layout.GridLayout)2 Button (org.eclipse.swt.widgets.Button)2 Tree (org.eclipse.swt.widgets.Tree)2 ColumnSpec (com.centurylink.mdw.plugin.designer.properties.editor.ColumnSpec)1 MappingEditor (com.centurylink.mdw.plugin.designer.properties.editor.MappingEditor)1