Java Code Examples for org.eclipse.swt.SWT#V_SCROLL

The following examples show how to use org.eclipse.swt.SWT#V_SCROLL . These examples are extracted from open source projects. 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
@Override
protected SourceViewer createPatternViewer(Composite parent) {
	IDocument document= new Document();
	JavaTextTools tools= JavaPlugin.getDefault().getJavaTextTools();
	tools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
	IPreferenceStore store= JavaPlugin.getDefault().getCombinedPreferenceStore();
	JavaSourceViewer viewer= new JavaSourceViewer(parent, null, null, false, SWT.V_SCROLL | SWT.H_SCROLL, store);
	SimpleJavaSourceViewerConfiguration configuration= new SimpleJavaSourceViewerConfiguration(tools.getColorManager(), store, null, IJavaPartitions.JAVA_PARTITIONING, false);
	viewer.configure(configuration);
	viewer.setEditable(false);
	viewer.setDocument(document);

	Font font= JFaceResources.getFont(PreferenceConstants.EDITOR_TEXT_FONT);
	viewer.getTextWidget().setFont(font);
	new JavaSourcePreviewerUpdater(viewer, configuration, store);

	Control control= viewer.getControl();
	GridData data= new GridData(GridData.HORIZONTAL_ALIGN_FILL | GridData.FILL_VERTICAL);
	control.setLayoutData(data);

	viewer.setEditable(false);
	return viewer;
}
 
Example 2
Source Project: birt   File: TaskSelectType.java    License: Eclipse Public License 1.0 6 votes vote down vote up
protected void createBottomTypeArea( Composite parent )
{
	ScrolledComposite sc = new ScrolledComposite( parent, SWT.V_SCROLL
			| SWT.H_SCROLL );
	{
		GridLayout layout = new GridLayout( );
		sc.setLayout( layout );
		GridData gridData = new GridData( GridData.FILL_BOTH );
		sc.setLayoutData( gridData );
		sc.setExpandHorizontal( true );
		sc.setExpandVertical( true );
	}

	cmpType = new Composite( sc, SWT.NONE );
	cmpType.setLayout( new GridLayout( 2, false ) );
	cmpType.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
	sc.setContent( cmpType );

	createLeftTypeTable( cmpType );
	populateChartTypes( );

	createRightDetails( cmpType );

	Point size = cmpType.computeSize( SWT.DEFAULT, SWT.DEFAULT );
	sc.setMinSize( size );
}
 
Example 3
@Override
protected Control createDialogArea(Composite parent) {
    GridData gd = new GridData(GridData.FILL_BOTH);
    StyledText text = new StyledText(parent,
            SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.H_SCROLL | SWT.V_SCROLL);
    text.setLayoutData(gd);

    text.setForeground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    text.setBackground(parent.getDisplay().getSystemColor(SWT.COLOR_INFO_BACKGROUND));

    text.setText(this.text);

    return text;
}
 
Example 4
private void createAllSchemaGroup(Composite composite) {
    final GridData gridData = new GridData();
    gridData.heightHint = 300;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;

    this.viewer = new ContainerCheckedTreeViewer(composite, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
    final Tree tree = viewer.getTree();
    tree.setLayoutData(gridData);

    viewer.setContentProvider(new TreeNodeContentProvider());
    viewer.setLabelProvider(new ViewLabelProvider());
}
 
Example 5
public RelationDisplayTableControl(Composite parent) {
  super(parent, SWT.NONE);
  setLayout(Widgets.buildContainerLayout(1));

  propViewer = new TableViewer(this,
      SWT.FULL_SELECTION | SWT.MULTI | SWT.BORDER | SWT.V_SCROLL);

  // Layout embedded table
  Table propTable = propViewer.getTable();
  propTable.setLayoutData(Widgets.buildGrabFillData());

  // initialize the table
  propTable.setHeaderVisible(true);
  propTable.setToolTipText("Relations Display Properties");
  EditColTableDef.setupTable(TABLE_DEF, propTable);

  // Configure cell editing
  CellEditor[] cellEditors = new CellEditor[TABLE_DEF.length];
  cellEditors[INDEX_NAME] = null;
  cellEditors[INDEX_SOURCE] = null;
  cellEditors[INDEX_COLOR] = new ColorCellEditor(propTable);
  cellEditors[INDEX_STYLE] = new ComboBoxCellEditor(propTable,
      toString(EdgeDisplayProperty.LineStyle.values(), true));
  cellEditors[INDEX_ARROWHEAD] = new ComboBoxCellEditor(propTable,
      toString(EdgeDisplayProperty.ArrowheadStyle.values(), true));

  propViewer.setCellEditors(cellEditors);
  propViewer.setLabelProvider(new EdgeDisplayLabelProvider());
  propViewer.setColumnProperties(EditColTableDef.getProperties(TABLE_DEF));
  propViewer.setCellModifier(new EdgeDisplayCellModifier());

  // TODO: Add column sorters, filters?
  configSorters(propTable);

  // Configure content last: use updateTable() to render relations
  propViewer.setContentProvider(ArrayContentProvider.getInstance());
}
 
Example 6
private Composite createMergeViewer(Composite parent) {
    Composite composite = new Composite(parent, SWT.None);
    composite.setLayout(GridLayoutFactory.fillDefaults().spacing(LayoutConstants.getSpacing().x, 1).create());
    composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

    viewer = new TreeViewer(composite,
            SWT.VIRTUAL | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FULL_SELECTION | SWT.BORDER);
    viewer.getTree().setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    viewer.setUseHashlookup(true);
    ColumnViewerToolTipSupport.enableFor(viewer);
    viewer.getTree().setHeaderVisible(true);
    viewer.getTree().setLinesVisible(true);
    viewer.setContentProvider(new SmartImportBdmTreeContentProvider());

    TableLayout layout = new TableLayout();
    layout.addColumnData(new ColumnWeightData(6, true));
    layout.addColumnData(new ColumnWeightData(2, true));
    viewer.getTree().setLayout(layout);

    createModelColumn();
    createActionColumn();

    IViewerObservableValue singleSelectionObservable = ViewerProperties.singleSelection().observe(viewer);
    viewer.addDoubleClickListener(e -> viewer.setExpandedState(singleSelectionObservable.getValue(),
            !viewer.getExpandedState(singleSelectionObservable.getValue())));
    return composite;
}
 
Example 7
private TreeViewer createViewer(Composite parent) {
	TreeViewer treeViewer= new TreeViewer(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
	GridData gd= new GridData(GridData.FILL_BOTH);
	gd.widthHint= convertWidthInCharsToPixels(40);
	gd.heightHint= convertHeightInCharsToPixels(15);
	treeViewer.getTree().setLayoutData(gd);
	treeViewer.setLabelProvider(new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_SMALL_ICONS));
	treeViewer.setContentProvider(new DestinationContentProvider(getDestinationValidator()));
	treeViewer.setComparator(new JavaElementComparator());
	treeViewer.setInput(JavaCore.create(ResourcesPlugin.getWorkspace().getRoot()));
	return treeViewer;
}
 
Example 8
protected void createParametersTable(Composite parent) {
    parametersTableViewer = new TableViewer(parent,
            SWT.FULL_SELECTION | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL | SWT.MULTI);
    parametersTableViewer.getControl()
            .setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).create());
    parametersTableViewer.getTable().setData(SWTBotConstants.SWTBOT_WIDGET_ID_KEY, QUERY_PARAMETERS_VIEWER_ID);
    ColumnViewerToolTipSupport.enableFor(parametersTableViewer);
    parametersTableViewer.getTable().setHeaderVisible(true);
    parametersTableViewer.setContentProvider(new ObservableListContentProvider());
    parametersTableViewer.addFilter(createSearchFilter());

    TableLayout tableLayout = new TableLayout();
    tableLayout.addColumnData(new ColumnWeightData(1));
    tableLayout.addColumnData(new ColumnWeightData(1));
    tableLayout.addColumnData(new ColumnWeightData(2));
    parametersTableViewer.getTable().setLayout(tableLayout);

    createNameColumn(parametersTableViewer);
    createTypeColumn(parametersTableViewer);
    createDescriptionColumn(parametersTableViewer);

    selectedQueryParameterObservableList = EMFObservables.observeDetailList(Realm.getDefault(),
            querySelectedObservable,
            BusinessDataModelPackage.Literals.QUERY__QUERY_PARAMETERS);
    parametersMultipleSelectionObservable = ViewerProperties.multipleSelection(QueryParameter.class)
            .observe(parametersTableViewer);
    parametersTableViewer.setInput(selectedQueryParameterObservableList);
}
 
Example 9
protected FigureCanvas createCanvas ()
{
    final FigureCanvas canvas = new FigureCanvas ( this, SWT.H_SCROLL | SWT.V_SCROLL | SWT.NO_REDRAW_RESIZE );

    addControlListener ( new ControlAdapter () {
        @Override
        public void controlResized ( final ControlEvent e )
        {
            handleResize ( getBounds () );
        }
    } );

    return canvas;
}
 
Example 10
Source Project: nebula   File: GridSnippet3.java    License: Eclipse Public License 2.0 5 votes vote down vote up
public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setLayout(new FillLayout());

    Grid grid = new Grid(shell,SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
    grid.setHeaderVisible(true);
    GridColumn column = new GridColumn(grid,SWT.NONE);
    column.setText("Column 1");
    column.setWidth(100);
    GridColumn column2 = new GridColumn(grid,SWT.CHECK | SWT.CENTER);
    column2.setText("Column 2");
    column2.setWidth(100);
    GridItem item1 = new GridItem(grid,SWT.NONE);
    item1.setText("First Item");
    item1.setChecked(1,true);
    GridItem item2 = new GridItem(grid,SWT.NONE);
    item2.setText("Second Item");
    GridItem item3 = new GridItem(grid,SWT.NONE);
    item3.setText("Third Item");
    
    shell.setSize(250,250);
    shell.open ();
    while (!shell.isDisposed()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }
    display.dispose ();
}
 
Example 11
Source Project: uima-uimaj   File: AbstractSection.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * New text with tip.
 *
 * @param parent the parent
 * @param text the text
 * @param style the style
 * @param tip the tip
 * @return the text
 */
protected Text newTextWithTip(Composite parent, String text, int style, String tip) {
  Text t = toolkit.createText(parent, text, style);
  t.setToolTipText(tip);
  if ((style & SWT.V_SCROLL) == SWT.V_SCROLL) {
    t.setLayoutData(new GridData(GridData.FILL_BOTH));
  } else {
    t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
  addListenerForPastableWidget(t);
  return t;
}
 
Example 12
Source Project: http4e   File: SWTStyledTextExample.java    License: Apache License 2.0 5 votes vote down vote up
private static StyledText buildEditorText( Composite parent){
   final SourceViewer sourceViewer = new SourceViewer(parent, null, SWT.MULTI | SWT.V_SCROLL | SWT.WRAP);

   final XMLConfiguration sourceConf = new XMLConfiguration(new ColorManagerAdaptor(ResourceUtils.getResourceCache()));
   sourceViewer.configure(sourceConf);
   sourceViewer.setDocument(DocumentUtils.createDocument2());

   return sourceViewer.getTextWidget();
}
 
Example 13
public static void main(String[] args) {

		Display display = new Display();
		Shell shell = new Shell(display);
		GridLayout layout = new GridLayout(1, false);
		shell.setLayout(layout);

		final List<Person> items = createList();

		Composite parent = new Composite(shell, SWT.NONE);
		parent.setLayoutData(new GridData(GridData.FILL_BOTH));
		parent.setLayout(new GridLayout());

		// Left panel
		Table table = new Table(parent, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL
				| SWT.V_SCROLL);
		table.setLayoutData(new GridData(GridData.FILL_BOTH));

		// 2) Initialize the table viewer + SWT Table
		TableViewer viewer = new TableViewer(table);
		viewer.setContentProvider(ArrayContentProvider.getInstance());
		viewer.setLabelProvider(new LabelProvider());

		table.setHeaderVisible(true);
		table.setLinesVisible(true);

		// 3) Create Table columns with sort of paginated list.
		int pageSize = 10;
		final PageableController controller = new PageableController(pageSize);
		final IPageLoader<PageResult<Person>> pageLoader = new PageResultLoaderList<Person>(
				items);
		controller.addPageChangedListener(PageLoaderStrategyHelper
				.createLoadPageAndReplaceItemsListener(controller, viewer,
						pageLoader, PageResultContentProvider.getInstance(),
						null));

		// Create navigation page links
		ResultAndNavigationPageLinksRenderer resultAndPageLinksDecorator = new ResultAndNavigationPageLinksRenderer(
				parent, SWT.NONE, controller);
		resultAndPageLinksDecorator.setLayoutData(new GridData(
				GridData.FILL_HORIZONTAL));

		createColumns(viewer, controller);
		// 3) Set current page to 0 to refresh the table

		controller.setCurrentPage(0);

		shell.setSize(350, 250);
		shell.open();
		while (!shell.isDisposed()) {
			if (!display.readAndDispatch())
				display.sleep();
		}
		display.dispose();
	}
 
Example 14
/**
 * 创建映身
 * @param tparent
 *            ;
 */
private void createMapGroup(Composite tparent, GridData groupData, GridLayout groupLayout) {
	Group group = new Group(tparent, SWT.BORDER);
	group.setLayoutData(groupData);
	group.setLayout(groupLayout);
	group.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.group"));

	mapTableViewer = new TableViewer(group, SWT.FULL_SELECTION | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL
			| SWT.MULTI);
	mapTable = mapTableViewer.getTable();
	mapTable.setLinesVisible(true);
	mapTable.setHeaderVisible(true);

	GridDataFactory.fillDefaults().span(4, SWT.DEFAULT).grab(true, true).applyTo(mapTable);
	mapTableViewer.setLabelProvider(new TableViewerLabelProvider());
	mapTableViewer.setContentProvider(new ArrayContentProvider());

	String[] columnNames = new String[] { Messages.getString("srx.AddOrEditSrxConfigDialog.columnNames1"),
			Messages.getString("srx.AddOrEditSrxConfigDialog.columnNames2") };
	int[] columnAlignments = new int[] { SWT.LEFT, SWT.LEFT };
	for (int i = 0; i < columnNames.length; i++) {
		TableColumn tableColumn = new TableColumn(mapTable, columnAlignments[i]);
		tableColumn.setText(columnNames[i]);
		tableColumn.setWidth(50);
	}
	refreshTableWidth(mapTable);

	mapAddBtn = new Button(group, SWT.NONE);
	mapAddBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapAddBtn"));
	setButtonLayoutData(mapAddBtn);

	mapEditBtn = new Button(group, SWT.NONE);
	mapEditBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapEditBtn"));
	setButtonLayoutData(mapEditBtn);

	mapDeleteBtn = new Button(group, SWT.NONE);
	mapDeleteBtn.setText(Messages.getString("srx.AddOrEditSrxConfigDialog.mapDeleteBtn"));
	setButtonLayoutData(mapDeleteBtn);

	new Label(group, SWT.NONE);

	mapTableViewer.addDoubleClickListener(new IDoubleClickListener() {
		public void doubleClick(DoubleClickEvent event) {
			editMapRules();
		}
	});
}
 
Example 15
/**
 *
 * @param args
 */
public static void main (String [] args) {
    Display display = new Display ();
    Shell shell = new Shell (display);
    shell.setLayout(new FillLayout());

    Grid grid = new Grid(shell, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);

    grid.setHeaderVisible(true);
    GridColumn column = new GridColumn(grid, SWT.NONE);
    column.setText("Column 1");
    column.setWidth(100);

    GridColumn column2 = new GridColumn(grid, SWT.NONE);
    column2.setText("Column 2");
    column2.setWidth(100);

    GridItem item1 = new GridItem(grid, SWT.NONE);
    item1.setText("First Item");
    item1.setText(1, "xxxxxxx");

    GridItem item2 = new GridItem(grid, SWT.NONE);
    item2.setText("This cell spans two rows");
    item2.setText(1, "xxxxxxx");
    item2.setRowSpan(0, 1);
    item2.setColumnSpan(0, 1);


    GridItem item3 = new GridItem(grid, SWT.NONE);
    item3.setText("Third Item");
    item3.setText(1, "xxxxxxx");

    shell.setSize(200,200);
    shell.open ();

    while (!shell.isDisposed()) {
        if (!display.readAndDispatch ()) display.sleep ();
    }

    display.dispose ();
}
 
Example 16
Source Project: nebula   File: SnippetVirtual.java    License: Eclipse Public License 2.0 4 votes vote down vote up
public static void main(String[] args) {
	Display display = new Display();
	Shell shell = new Shell(display);
	shell.setLayout(new FillLayout());
	final Gallery gallery = new Gallery(shell, SWT.V_SCROLL | SWT.VIRTUAL);
	
	// Renderers
	DefaultGalleryGroupRenderer gr = new DefaultGalleryGroupRenderer();
	gr.setItemSize(64, 64);
	gr.setMinMargin(3);
	DefaultGalleryItemRenderer ir = new DefaultGalleryItemRenderer();

	gallery.setGroupRenderer(gr);
	gallery.setItemRenderer(ir);
	
	gallery.setVirtualGroups(true);

	gallery.addListener(SWT.SetData, new Listener() {

		public void handleEvent(Event event) {
			GalleryItem item = (GalleryItem) event.item;
			int index;
			if (item.getParentItem() != null) {
				index = item.getParentItem().indexOf(item);
				item.setItemCount(0);
			} else {
				index = gallery.indexOf(item);
				item.setItemCount(100);
			}

			System.out.println( "setData index " + index); //$NON-NLS-1$
			// Your image here
			// item.setImage(eclipseImage);
			item.setText("Item " + index); //$NON-NLS-1$
		}

	});

	gallery.setItemCount(100);
	shell.pack();
	shell.open();
	while (!shell.isDisposed()) {
		if (!display.readAndDispatch())
			display.sleep();
	}
	display.dispose();
}
 
Example 17
@Override
protected Control createDialogArea(Composite parent){
	Composite ret = new Composite(parent, SWT.NONE);
	ret.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	ret.setLayout(new GridLayout());
	if ((type & TEMPLATE) != 0) {
		new Label(ret, SWT.NONE).setText(Messages.DocumentSelectDialog_subject); //$NON-NLS-1$
		tBetreff = SWTHelper.createText(ret, 1, SWT.NONE);
		new Label(ret, SWT.SEPARATOR | SWT.HORIZONTAL);
	}
	tv = new TableViewer(ret, SWT.V_SCROLL);
	tv.setContentProvider(new IStructuredContentProvider() {
		
		public Object[] getElements(Object inputElement){
			Query<Brief> qbe = new Query<Brief>(Brief.class);
			if (type == TYPE_LOAD_DOCUMENT) {
				qbe.add(Brief.FLD_TYPE, Query.NOT_EQUAL, Brief.TEMPLATE);
			} else {
				String sys = type == TYPE_LOAD_SYSTEMPLATE ? Query.EQUALS : Query.NOT_EQUAL;
				qbe.add(Brief.FLD_TYPE, Query.EQUALS, Brief.TEMPLATE);
				qbe.add(Brief.FLD_KONSULTATION_ID, sys, "SYS"); //$NON-NLS-1$
				qbe.startGroup();
				qbe.add(Brief.FLD_DESTINATION_ID, Query.EQUALS, CoreHub.actMandant.getId());
				qbe.or();
				qbe.add(Brief.FLD_DESTINATION_ID, Query.EQUALS, StringTool.leer);
				qbe.endGroup();
			}
			qbe.and();
			qbe.add("deleted", Query.NOT_EQUAL, StringConstants.ONE); //$NON-NLS-1$
			
			if (type != TYPE_LOAD_DOCUMENT) {
				qbe.orderBy(false, Brief.FLD_SUBJECT);
			} else {
				qbe.orderBy(false, Brief.FLD_DATE);
			}
			List<Brief> l = qbe.execute();
			return l.toArray();
		}
		
		public void dispose(){}
		
		public void inputChanged(Viewer viewer, Object oldInput, Object newInput){}
	});
	tv.setLabelProvider(new MyLabelProvider());
	makeActions();
	menu = new MenuManager();
	menu.setRemoveAllWhenShown(true);
	menu.addMenuListener(new IMenuListener() {
		public void menuAboutToShow(IMenuManager manager){
			menu.add(editNameAction);
			if (type == TYPE_LOAD_TEMPLATE) {
				// only show in load template dialog
				Brief sel =
					(Brief) ((IStructuredSelection) tv.getSelection()).getFirstElement();
				if (getDontAskForAddresseeForThisTemplate(sel)) {
					menu.add(editDontAskForAddressee);
					editDontAskForAddressee.setChecked(false);
				} else {
					menu.add(editDontAskForAddressee);
					editDontAskForAddressee.setChecked(true);
				}
			}
			menu.add((type & TEMPLATE) != 0 ? deleteTemplateAction : deleteTextAction);
		}
	});
	tv.getControl().setMenu(menu.createContextMenu(tv.getControl()));
	tv.getControl().setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
	tv.setInput(this);
	tv.addDoubleClickListener(new IDoubleClickListener() {
		@Override
		public void doubleClick(DoubleClickEvent event){
			okPressed();
		}
	});
	return ret;
}
 
Example 18
protected TextViewer createViewer(final Composite parent) {
	return new SourceViewer(parent,null,SWT.BORDER | SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL);
}
 
Example 19
protected void createMemberValuesGroup( Composite content )
{
	group = new Group( content, SWT.NONE );
	group.setText( Messages.getString( "CrosstabFilterConditionBuilder.Label.SelColumnMemberValue" ) ); //$NON-NLS-1$
	group.setLayout( new GridLayout( ) );

	memberValueTable = new Table( group, SWT.SINGLE
			| SWT.BORDER
			| SWT.H_SCROLL
			| SWT.V_SCROLL
			| SWT.FULL_SELECTION );
	memberValueTable.setLinesVisible( true );
	memberValueTable.setHeaderVisible( true );
	memberValueTable.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	GridData gd = new GridData( GridData.FILL_BOTH );
	gd.heightHint = 150;
	gd.horizontalSpan = 3;
	group.setLayoutData( gd );

	dynamicViewer = new TableViewer( memberValueTable );

	TableColumn column = new TableColumn( memberValueTable, SWT.LEFT );
	column.setText( columns[0] );
	column.setWidth( 15 );

	TableColumn column1 = new TableColumn( memberValueTable, SWT.LEFT );
	column1.setResizable( columns[1] != null );
	if ( columns[1] != null )
	{
		column1.setText( columns[1] );
	}
	column1.setWidth( 200 );

	TableColumn column2 = new TableColumn( memberValueTable, SWT.LEFT );
	column2.setResizable( columns[2] != null );
	if ( columns[2] != null )
	{
		column2.setText( columns[2] );
	}
	column2.setWidth( 200 );

	dynamicViewer.setColumnProperties( columns );
	editor = new ExpressionValueCellEditor( dynamicViewer.getTable( ),
			SWT.READ_ONLY );
	TextCellEditor textEditor = new TextCellEditor( dynamicViewer.getTable( ),
			SWT.READ_ONLY );
	TextCellEditor textEditor2 = new TextCellEditor( dynamicViewer.getTable( ),
			SWT.READ_ONLY );
	CellEditor[] cellEditors = new CellEditor[]{
			textEditor, textEditor2, editor
	};
	if ( designHandle != null )
	{
		editor.setExpressionProvider( getCrosstabExpressionProvider( ) );
		editor.setReportElement( (ExtendedItemHandle) designHandle );
	}

	dynamicViewer.setCellEditors( cellEditors );

	dynamicViewer.setContentProvider( contentProvider );
	dynamicViewer.setLabelProvider( labelProvider );
	dynamicViewer.setCellModifier( cellModifier );
	dynamicViewer.addSelectionChangedListener( selectionChangeListener );
}
 
Example 20
Source Project: nebula   File: CTreeViewer.java    License: Eclipse Public License 2.0 2 votes vote down vote up
/**
 * Creates a tree viewer on a newly-created tree control under the given
 * parent. The tree control is created using the SWT style bits
 * <code>MULTI, H_SCROLL, V_SCROLL,</code> and <code>BORDER</code>. The
 * viewer has no input, no content provider, a default label provider, no
 * sorter, and no filters.
 * 
 * @param parent
 *            the parent control
 */
public CTreeViewer(Composite parent) {
	this(parent, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
}