org.eclipse.jface.viewers.EditingSupport Java Examples

The following examples show how to use org.eclipse.jface.viewers.EditingSupport. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GridViewerColumn.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void setEditingSupport(EditingSupport editingSupport)
{
	currentEditingSupport = editingSupport;
	if (!getColumn().isVisible()) {
		return;
	}

    if (editingSupport instanceof CheckEditingSupport)
    {
        if (checkEditingSupport == null)
        {
            final int colIndex = getColumn().getParent().indexOf(getColumn());

            getColumn().getParent().addListener(SWT.Selection, new Listener()
            {
                public void handleEvent(Event event)
                {
                    if (event.detail == SWT.CHECK && event.index == colIndex)
                    {
                        GridItem item = (GridItem)event.item;
                        Object element = item.getData();
                        checkEditingSupport.setValue(element, new Boolean(item.getChecked(colIndex)));
                    }
                }
            });
        }
        checkEditingSupport = (CheckEditingSupport)editingSupport;
    }
    else
    {
        super.setEditingSupport(editingSupport);
    }
}
 
Example #2
Source File: GridViewerColumn.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void setEditingSupport(EditingSupport editingSupport)
{
    if (editingSupport instanceof CheckEditingSupport)
    {
        if (checkEditingSupport == null)
        {
            final int colIndex = getColumn().getParent().indexOf(getColumn());
            
            getColumn().getParent().addListener(SWT.Selection, new Listener()
            {                
                public void handleEvent(Event event)
                {                         
                    if (event.detail == SWT.CHECK && event.index == colIndex)
                    {
                        GridItem item = (GridItem)event.item;
                        Object element = item.getData();
                        checkEditingSupport.setValue(element, new Boolean(item.getChecked(colIndex)));
                    }
                }                
            });
        }
        checkEditingSupport = (CheckEditingSupport)editingSupport;
    }
    else
    {
        super.setEditingSupport(editingSupport);
    }        
}
 
Example #3
Source File: GridViewerColumn.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
public void setEditingSupport(EditingSupport editingSupport)
{
    if (editingSupport instanceof CheckEditingSupport)
    {
        if (checkEditingSupport == null)
        {
            final int colIndex = getColumn().getParent().indexOf(getColumn());
            
            getColumn().getParent().addListener(SWT.Selection, new Listener()
            {                
                public void handleEvent(Event event)
                {                         
                    if (event.detail == SWT.CHECK && event.index == colIndex)
                    {
                        GridItem item = (GridItem)event.item;
                        Object element = viewer.getElementAt(viewer.getGrid().indexOf(item));
                        checkEditingSupport.setValue(element, new Boolean(item.getChecked(colIndex)));
                    }
                }                
            });
        }
        checkEditingSupport = (CheckEditingSupport)editingSupport;
    }
    else
    {
        super.setEditingSupport(editingSupport);
    }        
}
 
Example #4
Source File: GridViewerColumn.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void setEditingSupport(EditingSupport editingSupport)
{
    if (editingSupport instanceof CheckEditingSupport)
    {
        if (checkEditingSupport == null)
        {
            final int colIndex = getColumn().getParent().indexOf(getColumn());
            
            getColumn().getParent().addListener(SWT.Selection, new Listener()
            {                
                public void handleEvent(Event event)
                {                         
                    if (event.detail == SWT.CHECK && event.index == colIndex)
                    {
                        GridItem item = (GridItem)event.item;
                        Object element = item.getData();
                        checkEditingSupport.setValue(element, new Boolean(item.getChecked(colIndex)));
                    }
                }                
            });
        }
        checkEditingSupport = (CheckEditingSupport)editingSupport;
    }
    else
    {
        super.setEditingSupport(editingSupport);
    }        
}
 
Example #5
Source File: GridViewerColumn.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
/** {@inheritDoc} */
public void setEditingSupport(EditingSupport editingSupport)
{
    if (editingSupport instanceof CheckEditingSupport)
    {
        if (checkEditingSupport == null)
        {
            final int colIndex = getColumn().getParent().indexOf(getColumn());
            
            getColumn().getParent().addListener(SWT.Selection, new Listener()
            {                
                public void handleEvent(Event event)
                {                         
                    if (event.detail == SWT.CHECK && event.index == colIndex)
                    {
                        GridItem item = (GridItem)event.item;
                        Object element = item.getData();
                        checkEditingSupport.setValue(element, new Boolean(item.getChecked(colIndex)));
                    }
                }                
            });
        }
        checkEditingSupport = (CheckEditingSupport)editingSupport;
    }
    else
    {
        super.setEditingSupport(editingSupport);
    }        
}
 
Example #6
Source File: GenericTableColumn.java    From offspring with MIT License 4 votes vote down vote up
@Override
public EditingSupport getEditingSupport(ColumnViewer viewer) {
  return new GenericEditingSupport(viewer, this);
}
 
Example #7
Source File: IGenericTableColumn.java    From offspring with MIT License votes vote down vote up
public EditingSupport getEditingSupport(ColumnViewer viewer);