本文整理匯總了Java中org.eclipse.jface.viewers.ColumnViewer類的典型用法代碼示例。如果您正苦於以下問題:Java ColumnViewer類的具體用法?Java ColumnViewer怎麽用?Java ColumnViewer使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ColumnViewer類屬於org.eclipse.jface.viewers包,在下文中一共展示了ColumnViewer類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: ColumnViewerSorter
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
public ColumnViewerSorter(ColumnViewer viewer, TableViewerColumn column) {
this.column = column;
this.viewer = viewer;
this.column.getColumn().addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if( ColumnViewerSorter.this.viewer.getComparator() != null ) {
if( ColumnViewerSorter.this.viewer.getComparator() == ColumnViewerSorter.this ) {
int tdirection = ColumnViewerSorter.this.direction;
if( tdirection == ASC ) {
setSorter(ColumnViewerSorter.this, DESC);
} else if( tdirection == DESC ) {
setSorter(ColumnViewerSorter.this, NONE);
}
} else {
setSorter(ColumnViewerSorter.this, ASC);
}
} else {
setSorter(ColumnViewerSorter.this, ASC);
}
}
});
}
示例2: hookListener
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
private void hookListener(final ColumnViewer viewer) {
Listener listener = new Listener() {
@Override
public void handleEvent(Event event) {
if ((event.detail & SWT.SELECTED) > 0) {
ViewerCell focusCell = getFocusCell();
ViewerRow row = focusCell.getViewerRow();
Assert.isNotNull(row, "Internal structure invalid. Item without associated row is not possible."); //$NON-NLS-1$
ViewerCell cell = row.getCell(event.index);
if (focusCell == null || !cell.equals(focusCell)) {
removeSelectionInformation(event, cell);
} else {
markFocusedCell(event, cell);
}
}
}
};
viewer.getControl().addListener(SWT.EraseItem, listener);
}
示例3: EntryCellEditingSupport
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
/**
* 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 EntryCellEditingSupport(ColumnViewer viewer, EntryCellContentProvider 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);
// Create the ComboBoxCellEditor.
comboCell = new ComboBoxCellEditor(parent, new String[] {}, SWT.DROP_DOWN | SWT.READ_ONLY);
comboCell.getControl().setBackground(parent.getBackground());
// Create a HashMap to contain values for discrete Entry values.
valueMap = new HashMap<String, Integer>();
return;
}
示例4: handleMove
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@SuppressWarnings({ "rawtypes", "unchecked" })
protected void handleMove(ColumnViewer leftTView, ColumnViewer rightTView) {
StructuredSelection s = (StructuredSelection) leftTView.getSelection();
if (!s.isEmpty()) {
List left = (List) leftTView.getInput();
List right = (List) rightTView.getInput();
if (left == null)
leftTView.setInput(new ArrayList());
if (right == null)
rightTView.setInput(new ArrayList());
for (Object obj : s.toArray()) {
left.remove(obj);
right.add(obj);
}
leftTView.refresh();
rightTView.refresh();
fireChangeEvent();
}
}
示例5: createButtonsShort
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
public void createButtonsShort(Composite composite, ColumnViewer leftTView, TableViewer rightTView,
boolean doubleClick) {
Button addField = new Button(composite, SWT.PUSH);
int chw = UIUtil.getCharWidth(addField) * 7;
addField.setText(">"); //$NON-NLS-1$
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.widthHint = chw;
addField.setLayoutData(gd);
addField.addSelectionListener(new MoveListener(leftTView, rightTView));
Button delField = new Button(composite, SWT.PUSH);
delField.setText("<"); //$NON-NLS-1$
delField.setLayoutData(GridDataUtil.clone(gd));
delField.addSelectionListener(new MoveListener(rightTView, leftTView));
if (doubleClick) {
// Add the doubleclick selection to the table viewers
leftTView.addDoubleClickListener(new MoveListener(leftTView, rightTView));
rightTView.addDoubleClickListener(new MoveListener(rightTView, leftTView));
}
}
示例6: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
_bookmarkViewer.getTable().dispose();
createUI_10_TableViewer(_viewerContainer);
_viewerContainer.layout();
// update the viewer
reloadViewer();
}
_viewerContainer.setRedraw(true);
return _bookmarkViewer;
}
示例7: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
_tourViewer.getTable().dispose();
createUI_50_TourViewer(_viewerContainer);
_viewerContainer.layout();
// update the viewer
reloadViewer();
}
_viewerContainer.setRedraw(true);
return _tourViewer;
}
示例8: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_icViewerContainer.setRedraw(false);
{
final ISelection selection = _icViewer.getSelection();
_icViewer.getTable().dispose();
createUI_212_IC_ViewerTable(_icViewerContainer);
_icViewerContainer.layout();
// update viewer
reloadViewer();
_icViewer.setSelection(selection);
}
_icViewerContainer.setRedraw(true);
return _icViewer;
}
示例9: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
_profileViewer.getTable().dispose();
createUI_12_ProfileViewer_Table(_viewerContainer);
_viewerContainer.layout();
// update the viewer
reloadViewer();
}
_viewerContainer.setRedraw(true);
return _profileViewer;
}
示例10: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_containerViewer.setRedraw(false);
{
_segmentViewer.getTable().dispose();
createUI_80_SegmentViewer(_containerViewer);
_containerViewer.layout();
// update the viewer
reloadViewer();
}
_containerViewer.setRedraw(true);
return _segmentViewer;
}
示例11: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
final Object[] expandedElements = _tourViewer.getExpandedElements();
final ISelection selection = _tourViewer.getSelection();
_tourViewer.getTree().dispose();
createUI_10_TourViewer(_viewerContainer);
_viewerContainer.layout();
_tourViewer.setInput(_rootItem = new TVICollatedTour_Root(this));
_tourViewer.setExpandedElements(expandedElements);
_tourViewer.setSelection(selection);
}
_viewerContainer.setRedraw(true);
return _tourViewer;
}
示例12: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
final Object[] expandedElements = _tourViewer.getExpandedElements();
final ISelection selection = _tourViewer.getSelection();
_tourViewer.getTree().dispose();
createUI_10_TourViewer(_viewerContainer);
_viewerContainer.layout();
_tourViewer.setInput(_rootItem = new TVICompareResultRootItem());
_tourViewer.setExpandedElements(expandedElements);
_tourViewer.setSelection(selection);
}
_viewerContainer.setRedraw(true);
return _tourViewer;
}
示例13: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
final Object[] expandedElements = _tourViewer.getExpandedElements();
final ISelection selection = _tourViewer.getSelection();
_viewerContainer.setRedraw(false);
{
_tourViewer.getTree().dispose();
createUI_10_TourViewer(_viewerContainer);
_viewerContainer.layout();
_tourViewer.setInput(_rootItem = new TVICatalogRootItem(this));
_tourViewer.setExpandedElements(expandedElements);
_tourViewer.setSelection(selection);
}
_viewerContainer.setRedraw(true);
return _tourViewer;
}
示例14: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
final Object[] expandedElements = _tourViewer.getExpandedElements();
final ISelection selection = _tourViewer.getSelection();
_tourViewer.getTree().dispose();
createUI_10_TourViewer(_viewerContainer);
_viewerContainer.layout();
_tourViewer.setInput(_rootItem = new TVITourBookRoot(this));
_tourViewer.setExpandedElements(expandedElements);
_tourViewer.setSelection(selection);
}
_viewerContainer.setRedraw(true);
return _tourViewer;
}
示例15: recreateViewer
import org.eclipse.jface.viewers.ColumnViewer; //導入依賴的package包/類
@Override
public ColumnViewer recreateViewer(final ColumnViewer columnViewer) {
_viewerContainer.setRedraw(false);
{
final Object[] expandedElements = _tagViewer.getExpandedElements();
final ISelection selection = _tagViewer.getSelection();
_tagViewer.getTree().dispose();
createUI_10_TagViewer(_viewerContainer);
_viewerContainer.layout();
_tagViewer.setInput(_rootItem = new TVITagViewRoot(this, _tagViewLayout));
_tagViewer.setExpandedElements(expandedElements);
_tagViewer.setSelection(selection);
}
_viewerContainer.setRedraw(true);
return _tagViewer;
}