当前位置: 首页>>代码示例>>Java>>正文


Java ColumnViewerEditorActivationEvent类代码示例

本文整理汇总了Java中org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent的典型用法代码示例。如果您正苦于以下问题:Java ColumnViewerEditorActivationEvent类的具体用法?Java ColumnViewerEditorActivationEvent怎么用?Java ColumnViewerEditorActivationEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ColumnViewerEditorActivationEvent类属于org.eclipse.jface.viewers包,在下文中一共展示了ColumnViewerEditorActivationEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: editElement

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
public void editElement(Object element, int column) {
	if (element instanceof TreePath) {
		setSelection(new TreeSelection((TreePath) element));
		GalleryItem[] items = gallery.getSelection();

		if (items.length == 1) {
			ViewerRow row = getViewerRowFromItem(items[0]);

			if (row != null) {
				ViewerCell cell = row.getCell(column);
				if (cell != null) {
					getControl().setRedraw(false);
					triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(cell));
					getControl().setRedraw(true);
				}
			}
		}
	} else {
		super.editElement(element, column);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:GalleryTreeViewer.java

示例2: setupAccessibleCellEditors

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
public static void setupAccessibleCellEditors(final TableViewer viewer, final int flags) {
    Check.notNull(viewer, "viewer"); //$NON-NLS-1$

    try {
        final MultiRowHighlighter cellHighlighter = new MultiRowHighlighter(viewer);

        final TableViewerFocusCellManager focusCellManager =
            new TableViewerFocusCellManager(viewer, cellHighlighter);

        final ColumnViewerEditorActivationStrategy activationStrategy =
            new ColumnViewerEditorActivationStrategy(viewer) {
                @Override
                protected boolean isEditorActivationEvent(final ColumnViewerEditorActivationEvent event) {
                    /*
                     * Deny any cell editor activation if there are multiple
                     * rows selected.
                     */
                    if (getViewer().getSelection() != null
                        && getViewer().getSelection() instanceof StructuredSelection
                        && ((StructuredSelection) getViewer().getSelection()).size() > 1) {
                        return false;
                    }

                    if (event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
                        && event.keyCode == SWT.CR) {
                        return true;
                    }

                    return super.isEditorActivationEvent(event);
                }
            };

        TableViewerEditor.create(viewer, focusCellManager, activationStrategy, flags);
    } catch (final Exception e) {
        log.warn("Could not configure cell editor accessibility", e); //$NON-NLS-1$
    }
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:38,代码来源:CellEditorAccessibility.java

示例3: initEditOnDoubleClick

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
private void initEditOnDoubleClick() {
	TreeViewerFocusCellManager focusCellManager = new TreeViewerFocusCellManager(treeViewer, new FocusCellOwnerDrawHighlighter(treeViewer));
	ColumnViewerEditorActivationStrategy activationSupport = new ColumnViewerEditorActivationStrategy(treeViewer) {
		@Override
		protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
			// Enable editor only with mouse double click
			if (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION) {
				EventObject source = event.sourceEvent;
				if (source instanceof MouseEvent && ((MouseEvent) source).button == 3)
					return false;

				return true;
			}

			return false;
		}
	};
	TreeViewerEditor.create(treeViewer, focusCellManager, activationSupport,
	// ColumnViewerEditor.TABBING_HORIZONTAL |
			ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | ColumnViewerEditor.TABBING_VERTICAL | ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:22,代码来源:StructureTreeWidget.java

示例4: editElement

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
public void editElement(Object element, int column) {
	try {
		getControl().setRedraw(false);
		Widget item = findItem(element);
		if (item != null) {
			ViewerRow row = getViewerRowFromItem(item);
			if (row != null) {
				ViewerCell cell = row.getCell(column);
				if (cell != null) {
					triggerEditorActivationEvent(new ColumnViewerEditorActivationEvent(
							cell));
				}
			}
		}
	} finally {
		getControl().setRedraw(true);
	}
	// }
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:23,代码来源:GridTableViewer.java

示例5: updateFocusCell

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
protected void updateFocusCell(ViewerCell focusCell, ColumnViewerEditorActivationEvent event) {
	Grid grid = ((Grid)getViewer().getControl());

	if (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
			|| event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL) {
		grid.setFocusColumn(grid.getColumn(focusCell.getColumnIndex()));
		grid.setFocusItem((GridItem) focusCell.getItem());
		
		if( selectionFollowsEditor ) {
			grid.setCellSelection(new Point(focusCell.getColumnIndex(),grid.indexOf((GridItem)focusCell.getItem())));
		}
	}
			
	grid.showColumn(grid.getColumn(focusCell.getColumnIndex()));
	grid.showItem((GridItem) focusCell.getItem()); 
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:20,代码来源:GridViewerEditor.java

示例6: activate

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
@Override
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
	super.activate(activationEvent);
	if (activationStyle != SWT.NONE) {

		boolean mouseSelection = activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION
				|| activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION;
		boolean keyboardSelection = activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED;
		boolean programmatic = activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
		boolean traversal = activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL;

		if (mouseSelection && (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0 || keyboardSelection
				&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0 || programmatic
				&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0 || traversal
				&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {

			comboBox.getDisplay().asyncExec(new Runnable() {
				@Override
				public void run() {
					comboBox.setListVisible(true);
				}
			});

		}
	}
}
 
开发者ID:sopeco,项目名称:DynamicSpotter,代码行数:27,代码来源:CustomComboBoxCellEditor.java

示例7: activate

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
@Override
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
	super.activate(activationEvent);
	boolean dropDown = true;
	if (dropDown) {
		getControl().getDisplay().asyncExec(new Runnable() {
			public void run() {
				((CCombo) getControl()).setListVisible(true);
			}
		});

	}
}
 
开发者ID:convertigo,项目名称:convertigo-eclipse,代码行数:14,代码来源:StringComboBoxPropertyDescriptor.java

示例8: initEditBehaviour

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
private void initEditBehaviour(final int type) {
		TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(tableViewer, new FocusCellOwnerDrawHighlighter(tableViewer));
		ColumnViewerEditorActivationStrategy activationSupport = new ColumnViewerEditorActivationStrategy(tableViewer) {
		    @Override
			protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
		    	logger.debug(event.toString());
		    	
				boolean singleSelect = ((IStructuredSelection)tableViewer.getSelection()).size() == 1;
				
				int mouseActivationType= 
						type == 0 ? ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION : ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION;
				
				boolean isLeftMouseSelect = event.eventType == mouseActivationType && ((MouseEvent)event.sourceEvent).button == 1;

				return singleSelect && (isLeftMouseSelect
						|| event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
						|| event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL);
		    	
		    	
		        // Enable editor only with mouse double click
//		        if (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION) {
//		            EventObject source = event.sourceEvent;
//		            if (source instanceof MouseEvent && ((MouseEvent)source).button == 3)
//		                return false;
//
//		            return true;
//		        }
//
//		        return false;
		    }
		};
		
		TableViewerEditor.create(tableViewer, focusCellManager, activationSupport, ColumnViewerEditor.TABBING_HORIZONTAL | 
			    ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR | 
			    ColumnViewerEditor.TABBING_VERTICAL |
			    ColumnViewerEditor.KEYBOARD_ACTIVATION);
	}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:38,代码来源:WordGraphEditor.java

示例9: isEditorActivationEvent

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
@Override
protected boolean isEditorActivationEvent(
		ColumnViewerEditorActivationEvent event) {
    if (event.eventType != EVENT_TYPE_OF_INTEREST) {
    	return false;
    }

    EventObject source = event.sourceEvent;
    if (source instanceof MouseEvent && ((MouseEvent)source).button == 3) {
        return false;
    }

    return true;
}
 
开发者ID:insweat,项目名称:hssd,代码行数:15,代码来源:EntryEditor.java

示例10: setViewerCellEditingOnDblClick

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
/**
 * Setups the start of cell editing on a {@link TableViewer} when a {@link DoubleClickEvent} occurs.
 * 
 * @param tviewer
 *          the table viewer
 */
public static void setViewerCellEditingOnDblClick(TableViewer tviewer) {
	ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(tviewer) {
		protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
			return event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION;
		}
	};

	TableViewerEditor.create(tviewer, actSupport, ColumnViewerEditor.DEFAULT);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:16,代码来源:UIUtil.java

示例11: setCellEditSupport

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
/**
 * Initialize cell editing.
 * 
 * @param viewer
 */
public static void setCellEditSupport(final TableViewer viewer) {

	final TableViewerFocusCellManager focusCellManager = new TableViewerFocusCellManager(
			viewer,
			new FocusCellOwnerDrawHighlighter(viewer));

	final ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(viewer) {
		@Override
		protected boolean isEditorActivationEvent(final ColumnViewerEditorActivationEvent event) {

			return (event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL)
					|| (event.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION)
					|| ((event.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED)
							&& (event.keyCode == SWT.CR))
					|| (event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC);
		}
	};

	TableViewerEditor.create(//
			viewer,
			focusCellManager,
			actSupport,
			ColumnViewerEditor.TABBING_HORIZONTAL //
					| ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR //
					| ColumnViewerEditor.TABBING_VERTICAL
					| ColumnViewerEditor.KEYBOARD_ACTIVATION);
}
 
开发者ID:wolfgang-ch,项目名称:mytourbook,代码行数:33,代码来源:UI.java

示例12: isEditorActivationEvent

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
@Override
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
	boolean result;
	if (event.character == '\r') {
		result = true;
	}
	else {
		result = super.isEditorActivationEvent(event);
	}
	return result;
}
 
开发者ID:jaloncad,项目名称:redmine.rap,代码行数:12,代码来源:PlanView.java

示例13: isEditorActivationEvent

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
@Override
protected boolean isEditorActivationEvent(ColumnViewerEditorActivationEvent event) {
	// Locals
	Boolean result = null;

	if (event.character == '\r') {
		result = true;
	}
	else {
		result = super.isEditorActivationEvent(event);
	}
	return result;
}
 
开发者ID:jaloncad,项目名称:redmine.rap,代码行数:14,代码来源:ActivationStrategy.java

示例14: activate

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
	super.activate(activationEvent);
	if (activationStyle != SWT.NONE) {
		boolean dropDown = false;
		if ((activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION || activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION)
				&& (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
				&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
				&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
				&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {
			dropDown = true;
		}

		if (dropDown) {
			getControl().getDisplay().asyncExec(new Runnable() {

				public void run() {
					((CCombo) getControl()).setListVisible(true);
				}

			});

		}
	}
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:31,代码来源:AbstractComboBoxCellEditor.java

示例15: activate

import org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent; //导入依赖的package包/类
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
	super.activate(activationEvent);
	if (activationStyle != SWT.NONE) {
		boolean dropDown = false;
		if ((activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_CLICK_SELECTION || activationEvent.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION)
				&& (activationStyle & DROP_DOWN_ON_MOUSE_ACTIVATION) != 0 ) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.KEY_PRESSED
				&& (activationStyle & DROP_DOWN_ON_KEY_ACTIVATION) != 0 ) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC
				&& (activationStyle & DROP_DOWN_ON_PROGRAMMATIC_ACTIVATION) != 0) {
			dropDown = true;
		} else if (activationEvent.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
				&& (activationStyle & DROP_DOWN_ON_TRAVERSE_ACTIVATION) != 0) {
			dropDown = true;
		}

		if (dropDown) {
			getControl().getDisplay().asyncExec(new Runnable() {

				public void run() {
					((CCombo) getControl()).setListVisible(true);
				}

			});

		}
	}
}
 
开发者ID:xored,项目名称:q7.quality.mockups,代码行数:31,代码来源:AbstractComboBoxCellEditor.java


注:本文中的org.eclipse.jface.viewers.ColumnViewerEditorActivationEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。