Java Code Examples for org.eclipse.jface.viewers.ColumnViewer#getControl()

The following examples show how to use org.eclipse.jface.viewers.ColumnViewer#getControl() . 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: GridViewerEditor.java    From nebula with Eclipse Public License 2.0 5 votes vote down vote up
GridViewerEditor(ColumnViewer viewer,
		ColumnViewerEditorActivationStrategy editorActivationStrategy,
		int feature) {
	super(viewer, editorActivationStrategy, feature);
	this.selectionFollowsEditor = (feature & SELECTION_FOLLOWS_EDITOR) == SELECTION_FOLLOWS_EDITOR;
	this.gridEditor = new GridEditor((Grid) viewer.getControl());
}
 
Example 2
Source File: GridViewerEditor.java    From translationstudio8 with GNU General Public License v2.0 5 votes vote down vote up
GridViewerEditor(ColumnViewer viewer,
		ColumnViewerEditorActivationStrategy editorActivationStrategy,
		int feature) {
	super(viewer, editorActivationStrategy, feature);
	this.selectionFollowsEditor = (feature & SELECTION_FOLLOWS_EDITOR) == SELECTION_FOLLOWS_EDITOR;
	this.gridEditor = new GridEditor((Grid) viewer.getControl());
}
 
Example 3
Source File: GenericEditingSupport.java    From offspring with MIT License 5 votes vote down vote up
public GenericEditingSupport(ColumnViewer viewer,
    IGenericTableColumn column) {
  super(viewer);
  this.editor = new TextCellEditor((Composite) viewer.getControl(),
      column.getAlignMent());
  this.column = column;
}
 
Example 4
Source File: GridViewerEditor.java    From tmxeditor8 with GNU General Public License v2.0 5 votes vote down vote up
GridViewerEditor(ColumnViewer viewer,
		ColumnViewerEditorActivationStrategy editorActivationStrategy,
		int feature) {
	super(viewer, editorActivationStrategy, feature);
	this.selectionFollowsEditor = (feature & SELECTION_FOLLOWS_EDITOR) == SELECTION_FOLLOWS_EDITOR;
	this.gridEditor = new GridEditor((Grid) viewer.getControl());
}
 
Example 5
Source File: TextCellEditingSupport.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * The default constructor.
 * 
 * @param viewer
 *            The viewer that is using this <code>EditingSupport</code>.
 *            <code>Control</code>s required by this class will be
 *            constructed under this viewer's <code>Control</code> (usually
 *            a <code>Table</code>).
 * @param contentProvider
 *            The content provider. The methods required as an
 *            <code>EditingSupport</code> are passed to this content
 *            provider.
 */
public TextCellEditingSupport(ColumnViewer viewer,
		ICellContentProvider contentProvider) {
	super(viewer);

	this.contentProvider = contentProvider;

	// Get the viewer's Composite so we can create the CellEditors.
	Composite parent = (Composite) viewer.getControl();

	// Create the TextCellEditor.
	textCell = new TextCellEditor(parent, SWT.LEFT);

	return;
}
 
Example 6
Source File: ComboCellEditingSupport.java    From ice with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * The default constructor.
 * 
 * @param viewer
 *            The viewer that is using this <code>EditingSupport</code>.
 *            <code>Control</code>s required by this class will be
 *            constructed under this viewer's <code>Control</code> (usually
 *            a <code>Table</code>).
 * @param contentProvider
 *            The content provider. The methods required as an
 *            <code>EditingSupport</code> are passed to this content
 *            provider.
 */
public ComboCellEditingSupport(ColumnViewer viewer, IComboCellContentProvider contentProvider) {
	super(viewer, contentProvider);

	// Store a reference to the IComboCellContentProvider.
	this.contentProvider = contentProvider;

	// Get the viewer's Composite so we can create the CellEditors.
	parent = (Composite) viewer.getControl();

	// Create a HashMap to contain values for discrete Entry values.
	valueMap = new HashMap<String, Integer>();

	return;
}
 
Example 7
Source File: AutoCompleteTextCellEditor.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public AutoCompleteTextCellEditor(ColumnViewer viewer) {
    super((Composite) viewer.getControl());
    Optional<KeyStroke> eclipseContentAssistKeyStroke = retrieveEclipseContentAssistKeyStroke();
    if (eclipseContentAssistKeyStroke.isPresent()) {
        contentAssistKeyStroke = eclipseContentAssistKeyStroke.get();
    } else {
        BonitaStudioLog.warning(
                "Unable to retrieve eclipse content assist binding. Content assist won't be available in editors. Check key binding for the `Content Assist` command in the eclipse preferences.",
                UIPlugin.PLUGIN_ID);
    }
}
 
Example 8
Source File: GridViewerEditor.java    From nebula with Eclipse Public License 2.0 4 votes vote down vote up
GridViewerEditor(ColumnViewer viewer,
		ColumnViewerEditorActivationStrategy editorActivationStrategy,
		int feature) {
	super(viewer, editorActivationStrategy, feature);
	this.gridEditor = new GridEditor((Grid) viewer.getControl());
}
 
Example 9
Source File: ConfigurationFormToolkit.java    From neoscada with Eclipse Public License 1.0 4 votes vote down vote up
public InlineEditingSupport ( final IObservableMap map, final ColumnViewer viewer, final DataBindingContext dbc )
{
    super ( viewer, dbc );
    this.map = map;
    this.cellEditor = new TextCellEditor ( (Composite)viewer.getControl () );
}
 
Example 10
Source File: EditingSupportBuilder.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public EditingSupportBuilder(ColumnViewer viewer) {
    this.viewer = viewer;
    this.cellEditorFunction = e -> new TextCellEditor((Composite) viewer.getControl());
}
 
Example 11
Source File: ComboBoxEditingSupportBuilder.java    From bonita-studio with GNU General Public License v2.0 4 votes vote down vote up
public ComboBoxEditingSupportBuilder(ColumnViewer viewer) {
    this.viewer = viewer;
    this.editor = new ComboBoxViewerCellEditor((Composite) viewer.getControl(), SWT.BORDER | SWT.READ_ONLY);
}
 
Example 12
Source File: LabOrderEditingSupport.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
protected void setUpCellEditor(ColumnViewer viewer){
	// set up validation of the cell editors
	textCellEditor = new TextCellEditor((Composite) viewer.getControl());

	textCellEditor.addListener(new ICellEditorListener() {
		@Override
		public void editorValueChanged(boolean oldValidState, boolean newValidState){
			if (newValidState) {
				textCellEditor.getControl().setBackground(
					Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
			} else {
				textCellEditor.getControl().setBackground(
					Display.getCurrent().getSystemColor(SWT.COLOR_RED));
			}
		}
		
		@Override
		public void cancelEditor(){
			textCellEditor.getControl().setBackground(
				Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
		
		@Override
		public void applyEditorValue(){
			textCellEditor.getControl().setBackground(
				Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
	});
	
	focusCell =
		new TableViewerFocusCellManager((TableViewer) viewer, new FocusCellHighlighter(viewer) {
		
	});
	
	ColumnViewerEditorActivationStrategy actSupport =
		new ColumnViewerEditorActivationStrategy(viewer) {
			@Override
			protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event){
				return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
					|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.CR)
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED && event.keyCode == SWT.KEYPAD_CR)
					|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
			}
		};
	
	TableViewerEditor.create((TableViewer) viewer, focusCell, actSupport,
		ColumnViewerEditor.TABBING_VERTICAL
			| ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
Example 13
Source File: LabResultEditingSupport.java    From elexis-3-core with Eclipse Public License 1.0 4 votes vote down vote up
protected void setUpCellEditor(ColumnViewer viewer){
	// set up validation of the cell editors
	textCellEditor = new TextCellEditor((Composite) viewer.getControl());
	
	textCellEditor.addListener(new ICellEditorListener() {
		@Override
		public void editorValueChanged(boolean oldValidState, boolean newValidState){
			if (newValidState) {
				textCellEditor.getControl()
					.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
			} else {
				textCellEditor.getControl()
					.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
			}
		}
		
		@Override
		public void cancelEditor(){
			textCellEditor.getControl()
				.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
		
		@Override
		public void applyEditorValue(){
			textCellEditor.getControl()
				.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
		}
	});
	
	focusCell =
		new TreeViewerFocusCellManager((TreeViewer) viewer, new FocusCellHighlighter(viewer) {
		
		});
		
	ColumnViewerEditorActivationStrategy actSupport =
		new ColumnViewerEditorActivationStrategy(viewer) {
			@Override
			protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event){
				return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
					|| event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
						&& event.keyCode == SWT.CR)
					|| (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
						&& event.keyCode == SWT.KEYPAD_CR)
					|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
			}
		};
	
	TreeViewerEditor.create((TreeViewer) viewer, focusCell, actSupport,
		ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
Example 14
Source File: CheckboxCellEditingSupport.java    From ice with Eclipse Public License 1.0 3 votes vote down vote up
/**
 * The default constructor.
 * 
 * @param viewer
 *            The viewer that is using this <code>EditingSupport</code>.
 *            <code>Control</code>s required by this class will be
 *            constructed under this viewer's <code>Control</code> (usually
 *            a <code>Table</code>).
 * @param contentProvider
 *            The content provider. The methods required as an
 *            <code>EditingSupport</code> are passed to this content
 *            provider.
 */
public CheckboxCellEditingSupport(ColumnViewer viewer,
		ICellContentProvider contentProvider) {
	super(viewer, contentProvider);

	// Get the viewer's Composite so we can create the CellEditors.
	Composite parent = (Composite) viewer.getControl();

	// Create the ButtonCellEditor.
	checkboxCell = new ButtonCellEditor(parent, SWT.CHECK);

	return;
}