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


Java ColumnViewerEditorActivationEvent.TRAVERSAL属性代码示例

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


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

示例1: updateFocusCell

/**
 * {@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,代码行数:19,代码来源:GridViewerEditor.java

示例2: activate

@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,代码行数:26,代码来源:CustomComboBoxCellEditor.java

示例3: initEditBehaviour

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,代码行数:37,代码来源:WordGraphEditor.java

示例4: setCellEditSupport

/**
 * 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,代码行数:32,代码来源:UI.java

示例5: activate

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,代码行数:30,代码来源:AbstractComboBoxCellEditor.java

示例6: activate

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,代码行数:30,代码来源:AbstractComboBoxCellEditor.java

示例7: createCustomArea

@Override
protected Control createCustomArea(final Composite parent) {
	Composite body = new Composite(parent, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(body);
	GridLayoutFactory.fillDefaults().numColumns(2).applyTo(body);

	ToolBar bar = new ToolBar(body, SWT.HORIZONTAL);
	ToolBarManager barMgr = new ToolBarManager(bar);
	barMgr.add(new AlignLeftAction());
	barMgr.add(new AlignCenterAction());
	barMgr.add(new AlignRightAction());
	barMgr.add(new InsColBeforeAction());
	barMgr.add(new InsColAfterAction());
	barMgr.add(new RmvColAction());
	barMgr.add(new InsRowAboveAction());
	barMgr.add(new InsRowBelowAction());
	barMgr.add(new RmvRowAction());
	barMgr.update(true);
	bar.pack();

	viewer = new TableViewer(body, style);
	GridDataFactory.fillDefaults().grab(true, true).span(2, 1).applyTo(viewer.getControl());

	table = viewer.getTable();
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	cellMgr = new TableViewerFocusCellManager(viewer, new FocusCellOwnerDrawHighlighter(viewer));

	ColumnViewerEditorActivationStrategy activator = 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.PROGRAMMATIC;
		}
	};

	TableViewerEditor.create(viewer, cellMgr, activator, features);

	MenuManager mgr = new MenuManager();
	mgr.add(new InsColBeforeAction());
	mgr.add(new InsColAfterAction());
	mgr.add(new RmvColAction());
	mgr.add(new Separator());
	mgr.add(new InsRowAboveAction());
	mgr.add(new InsRowBelowAction());
	mgr.add(new RmvRowAction());
	viewer.getControl().setMenu(mgr.createContextMenu(viewer.getControl()));

	tableModel = new TableModel();
	setInput(part);

	return body;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:57,代码来源:TableDialog.java

示例8: activate

@Override
public void activate(ColumnViewerEditorActivationEvent activationEvent) {
	if (activationEvent.eventType != ColumnViewerEditorActivationEvent.TRAVERSAL) {
		super.activate(activationEvent);
	}
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:6,代码来源:CheckboxCellEditor.java

示例9: setGenericTable

@Override
public void setGenericTable(IGenericTable table) {
  this.table = table;

  setUseHashlookup(true);
  setContentProvider(table.getContentProvider());
  // if (!(table.getContentProvider() instanceof
  // IPageableStructeredContentProvider)) {
  // this.comparator = new GenericComparator(table);
  // setComparator(comparator);
  // }

  ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(
      this) {

    @Override
    protected boolean isEditorActivationEvent(
        ColumnViewerEditorActivationEvent event) {
      return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
          || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
          || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
    }
  };

  TreeViewerEditor.create(this, actSupport,
      ColumnViewerEditor.TABBING_HORIZONTAL
          | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
          | ColumnViewerEditor.TABBING_VERTICAL
          | ColumnViewerEditor.KEYBOARD_ACTIVATION);

  createColumns();

  // setInput(null);
  // getTree().setHeaderVisible(true);
  getTree().setLinesVisible(true);
  getTree().layout();

  for (final IGenericTableColumn c : table.getColumns()) {
    if (c.getCellActivateHandler() != null) {
      getTree().addMouseMoveListener(mouseMoveListener);
      getTree().addMouseListener(mouseListener);
      break;
    }
  }
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:45,代码来源:GenerericTreeViewer.java

示例10: setGenericTable

@Override
public void setGenericTable(IGenericTable table) {
  this.table = table;

  setUseHashlookup(true);
  setContentProvider(table.getContentProvider());
  if (!(table.getContentProvider() instanceof IPageableStructeredContentProvider)) {
    this.comparator = new GenericComparator(table);
    setComparator(comparator);
  }

  ColumnViewerEditorActivationStrategy actSupport = new ColumnViewerEditorActivationStrategy(
      this) {

    @Override
    protected boolean isEditorActivationEvent(
        ColumnViewerEditorActivationEvent event) {
      return event.eventType == ColumnViewerEditorActivationEvent.TRAVERSAL
          || event.eventType == ColumnViewerEditorActivationEvent.MOUSE_DOUBLE_CLICK_SELECTION
          || event.eventType == ColumnViewerEditorActivationEvent.PROGRAMMATIC;
    }
  };

  TableViewerEditor.create(this, actSupport,
      ColumnViewerEditor.TABBING_HORIZONTAL
          | ColumnViewerEditor.TABBING_MOVE_TO_ROW_NEIGHBOR
          | ColumnViewerEditor.TABBING_VERTICAL
          | ColumnViewerEditor.KEYBOARD_ACTIVATION);

  createColumns();
  // try {
  // getTable().setRedraw(false);
  // calculateSizes();
  // }
  // finally {
  // getTable().setRedraw(true);
  // }

  // setInput(null);
  getTable().setHeaderVisible(true);
  getTable().setLinesVisible(true);
  getTable().layout();

  for (final IGenericTableColumn c : table.getColumns()) {
    if (c.getCellActivateHandler() != null) {
      getTable().addMouseMoveListener(mouseMoveListener);
      getTable().addMouseListener(mouseListener);
      break;
    }
  }
}
 
开发者ID:incentivetoken,项目名称:offspring,代码行数:51,代码来源:GenerericTableViewer.java

示例11: setUpCellEditor

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);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:50,代码来源:LabOrderEditingSupport.java

示例12: setUpCellEditor

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);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:51,代码来源:LabResultEditingSupport.java


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