Java Code Examples for org.eclipse.swt.widgets.Tree.setLayoutData()

The following are Jave code examples for showing how to use setLayoutData() of the org.eclipse.swt.widgets.Tree class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: n4js   File: CustomElementSelectionForm.java   View Source Code Vote up 6 votes
/**
 * Create the composite.
 */
public CustomElementSelectionForm(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(2, false));

	treeViewer = new TreeViewer(this, SWT.BORDER);
	Tree tree = getTreeViewer().getTree();

	// Set a minimum height to prevent weird dialog dimensions
	tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());

	elementLabel = new Label(this, SWT.NONE);
	elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
	elementLabel.setText("New Label");

	elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
	elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
 
Example 2
Project: typescript.java   File: AbstractInformationControl.java   View Source Code Vote up 6 votes
/**
 * Creates tree viewer to manage content
 * 
 * @param parent
 *            parent control
 */
private void createTreeViewer(Composite parent) {
	int style = SWT.H_SCROLL | SWT.V_SCROLL;
	// Create the tree
	Tree widget = new Tree(parent, style);
	// Configure the layout
	GridData data = new GridData(GridData.FILL_BOTH);
	data.heightHint = widget.getItemHeight() * 12;
	widget.setLayoutData(data);

	treeViewer = new TreeViewer(widget);
	namePatternFilter = new QuickOutlineNamePatternFilter();
	treeViewer.addFilter(namePatternFilter);
	treeContentProvider = getContentProvider();
	treeViewer.setContentProvider(treeContentProvider);
	treeLabelProvider = getLabelProvider();
	treeViewer.setLabelProvider(treeLabelProvider);
	treeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
	treeViewer.setUseHashlookup(true);
	treeViewer.setInput(getInitialInput());
}
 
Example 3
Project: traceability-assistant-eclipse-plugins   File: ADOSelectionPage.java   View Source Code Vote up 6 votes
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_ADO);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
Example 4
Project: traceability-assistant-eclipse-plugins   File: DXMISelectionPage.java   View Source Code Vote up 6 votes
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_DXMI);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
Example 5
Project: traceability-assistant-eclipse-plugins   File: REASelectionPage.java   View Source Code Vote up 6 votes
/**
 * Create contents of the wizard.
 *
 * @param parent the parent
 */
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	container.setLayout(new GridLayout(1, false));
	
	treeViewer = new WorkbenchTreeViewer(container, SWT.SINGLE, CarchaWizard.EXTENSIONS_REA);
	Tree tree = treeViewer.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	treeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event) {
			setPageComplete(validatePage());
		}
	});
	StructuredSelection selection = getSelection();
	if(selection != null)
		treeViewer.setSelection(selection);
	
	setControl(container);
	
	setPageComplete(validatePage());
}
 
Example 6
Project: PDFReporter-Studio   File: JavaExpressionEditorComposite.java   View Source Code Vote up 6 votes
private void createObjectsNavigator(Composite parent) {
	objectsNavigator = new TreeViewer(parent, SWT.BORDER);
	Tree tree = objectsNavigator.getTree();
	tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	objectsNavigator
			.setContentProvider(new ObjectsNavigatorContentProvider());
	objectsNavigator.setLabelProvider(new ObjectsNavigatorLabelProvider());

	objectsNavigator
			.addSelectionChangedListener(new ISelectionChangedListener() {

				public void selectionChanged(SelectionChangedEvent event) {
					Object selItem = ((IStructuredSelection) event
							.getSelection()).getFirstElement();
					if (selItem instanceof ObjectCategoryItem) {
						updateDetailsPanel((ObjectCategoryItem) selItem);
					}
				}
			});
}
 
Example 7
Project: sophie   File: SystemTree.java   View Source Code Vote up 6 votes
/**
 * Create a new tree listing Solr system information.
 * 
 * @param composite
 *            Parent composite.
 */
public SystemTree(Composite composite) throws SophieException {
	// Instantiate Tree.
	tree = new Tree(composite, SWT.BORDER);
	tree.setHeaderVisible(true);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));

	// Create name/value columns.
	columnName = new TreeColumn(tree, SWT.LEFT);
	columnName.setText("Name");
	columnValue = new TreeColumn(tree, SWT.LEFT);
	columnValue.setText("Value");

	// Populate tree with data from Solr.
	populate();

	// Pack columns.
	columnName.pack();
	columnValue.pack();
}
 
Example 8
Project: convertigo-eclipse   File: ProjectSchemaWizardPage.java   View Source Code Vote up 5 votes
public void createControl(Composite parent) {
	Composite container = new Composite(parent, SWT.NULL);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Project:");
	
	tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
	tree.setHeaderVisible(false);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
	gridData.verticalSpan = 20;
	gridData.horizontalSpan = 2;
	tree.setLayoutData(gridData);		
	tree.addListener(SWT.Selection, new Listener() {
		public void handleEvent(final Event event) {
			TreeItem item = (TreeItem) event.item;
			projectName = item.getText();
			dialogChanged();
		}
	});
	tree.setVisible(false);
	
	initialize();
	setControl(container);
	dialogChanged();
}
 
Example 9
Project: Vitruv   File: ApplicationSelectionPage.java   View Source Code Vote up 5 votes
@Override
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	Label label1 = new Label(container, SWT.NONE);
	label1.setText(SELECTION_LABEL);
	tree = new Tree(container, SWT.CHECK | SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 1;
	GridData treeGridData = new GridData(GridData.FILL_BOTH);
	tree.setLayoutData(treeGridData);
	tree.addListener(SWT.Selection, new Listener() {

		@Override
		public void handleEvent(Event event) {
			if (event.detail == SWT.CHECK) {
				TreeItem item = (TreeItem) event.item;
				if (item.getChecked()) {
					selectedApplications.add((VitruvApplication) item.getData());
				} else {
					selectedApplications.remove(item.getData());
				}
				setPageComplete(!selectedApplications.isEmpty());
			}
		}
	});

	setControl(container);
	setPageComplete(false);
}
 
Example 10
Project: texlipse   File: TexlipseProjectFilesWizardPage.java   View Source Code Vote up 5 votes
/**
 * Create a directory tree settings box.
 * @param parent the parent container
 */
private void createTreeControl(Composite parent) {

    dirTree = new Tree(parent, SWT.SINGLE | SWT.BORDER);
    dirTree.setToolTipText(TexlipsePlugin.getResourceString("projectWizardDirTreeTooltip"));
    dirTree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));

    recreateSubTree();
}
 
Example 11
Project: ermasterr   File: CompositeFactory.java   View Source Code Vote up 5 votes
public static ContainerCheckedTreeViewer createCheckedTreeViewer(final AbstractDialog dialog, final Composite parent, final int height, final int span) {
    final GridData gridData = new GridData();
    gridData.heightHint = height;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalSpan = span;

    final ContainerCheckedTreeViewer viewer = new ContainerCheckedTreeViewer(parent, 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());

    if (dialog != null) {
        viewer.addCheckStateListener(new ICheckStateListener() {

            @Override
            public void checkStateChanged(final CheckStateChangedEvent event) {
                dialog.validate();
            }

        });
    }

    return viewer;
}
 
Example 12
Project: ermaster-k   File: CompositeFactory.java   View Source Code Vote up 5 votes
public static ContainerCheckedTreeViewer createCheckedTreeViewer(
		final AbstractDialog dialog, Composite parent, int height, int span) {
	GridData gridData = new GridData();
	gridData.heightHint = height;
	gridData.horizontalAlignment = GridData.FILL;
	gridData.grabExcessHorizontalSpace = true;
	gridData.horizontalSpan = span;

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

	viewer.setContentProvider(new TreeNodeContentProvider());
	viewer.setLabelProvider(new ViewLabelProvider());

	if (dialog != null) {
		viewer.addCheckStateListener(new ICheckStateListener() {

			public void checkStateChanged(CheckStateChangedEvent event) {
				dialog.validate();
			}

		});
	}

	return viewer;
}
 
Example 13
Project: NEXCORE-UML-Modeler   File: StereotypePropertyComposite.java   View Source Code Vote up 5 votes
/**
 * 뷰어가 담길 컴포지트 생성
 * 
 * @param parent
 * @return Composite
 */
public Composite createComposite(final Composite parent) {
    Tree tree = new Tree(parent, SWT.V_SCROLL | SWT.MULTI | SWT.FULL_SELECTION);

    tree.setLinesVisible(true);
    tree.setHeaderVisible(true);

    String[] strHeadings = { UMLMessage.LABEL_PROPERTY, UMLMessage.LABEL_VALUE };

    TreeColumn propertyTreeColumn = new TreeColumn(tree, SWT.NONE);
    propertyTreeColumn.setWidth(240);
    propertyTreeColumn.setText(strHeadings[0]);
    propertyTreeColumn.setAlignment(SWT.LEFT);
    propertyTreeColumn.setResizable(true);

    TreeColumn valueTreeColumn = new TreeColumn(tree, SWT.NONE);
    valueTreeColumn.setWidth(300);
    valueTreeColumn.setText(strHeadings[1]);
    valueTreeColumn.setAlignment(SWT.LEFT);
    valueTreeColumn.setResizable(true);

    GridData gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 150;
    gridData.horizontalSpan = 2;
    tree.setLayoutData(gridData);

    viewer = new TreeViewer(tree);
    tree.setItemCount(20);

    viewer.setContentProvider(new StereotypePropertyTreeContentProvider());
    viewer.setLabelProvider(new StereotypePropertyTableColumnLabelProvider(this));

    // viewer.setInput(input);
    viewer.addSelectionChangedListener(new StereotypePropertySelectionChangedListener(parent, this));

    return parent;
}
 
Example 14
Project: eclipse-code-lines-plugin   File: CheckboxTreeAndListGroup.java   View Source Code Vote up 5 votes
protected void createTreeViewer(Composite parent, int width, int height)
{
    Tree tree = new Tree(parent, 32);
    GridData data = new GridData(1808);
    data.widthHint = width;
    data.heightHint = height;
    tree.setLayoutData(data);
    fTreeViewer = new CheckboxTreeViewer(tree);
    fTreeViewer.setUseHashlookup(true);
    fTreeViewer.setContentProvider(fTreeContentProvider);
    fTreeViewer.setLabelProvider(fTreeLabelProvider);
    fTreeViewer.addTreeListener(this);
    fTreeViewer.addCheckStateListener(this);
    fTreeViewer.addSelectionChangedListener(this);
}
 
Example 15
Project: erflute   File: AbstractSelectImportedObjectDialog.java   View Source Code Vote up 5 votes
private void createAllObjectGroup(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 16
Project: erflute   File: SelectImportedSchemaDialog.java   View Source Code Vote up 5 votes
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 17
Project: convertigo-eclipse   File: ComponentInfoWizardPage.java   View Source Code Vote up 4 votes
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Name:");

	beanName = new Text(container, SWT.BORDER | SWT.SINGLE);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	beanName.setLayoutData(gd);
	beanName.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			dialogChanged();
		}
	});
	
	if (parentObject instanceof CouchDbConnector || parentObject instanceof FullSyncConnector) {
		couchVariablesComposite = new CouchVariablesComposite(container, SWT.V_SCROLL);
		
		GridData couchVarData = new GridData(GridData.FILL_BOTH);
		couchVarData.horizontalSpan = 2;
		
		couchVariablesComposite.setLayoutData(couchVarData);
		
	} else {
		tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
		tree.setHeaderVisible(false);
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		gridData.verticalSpan = 20;
		gridData.horizontalSpan = 2;
		tree.setLayoutData(gridData);		
		tree.addListener(SWT.Selection, new Listener() {
			public void handleEvent(final Event event) {
				TreeItem item = (TreeItem) event.item;
				treeItemName = item.getText();
				String suffix = getBeanName().endsWith(ScHandlerStatement.EVENT_ENTRY_HANDLER) ? 
						ScHandlerStatement.EVENT_ENTRY_HANDLER:
							getBeanName().endsWith(ScHandlerStatement.EVENT_EXIT_HANDLER) ?
									ScHandlerStatement.EVENT_EXIT_HANDLER : "";
				setBeanName("on"+ treeItemName + suffix);
				dialogChanged();
			}
		});
		tree.setVisible(false);
	}
	
	initialize();
	dialogChanged();
	setControl(container);
}
 
Example 18
Project: convertigo-eclipse   File: ObjectInfoWizardPage.java   View Source Code Vote up 4 votes
public void createControl(Composite parent) {
	container = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	container.setLayout(layout);
	layout.numColumns = 2;
	layout.verticalSpacing = 9;

	Label label = new Label(container, SWT.NULL);
	label.setText("&Name:");

	beanName = new Text(container, SWT.BORDER | SWT.SINGLE);
	GridData gd = new GridData(GridData.FILL_HORIZONTAL);
	beanName.setLayoutData(gd);
	beanName.addModifyListener(new ModifyListener() {
		public void modifyText(ModifyEvent e) {
			dialogChanged();
		}
	});
	
	if (parentObject instanceof CouchDbConnector || parentObject instanceof FullSyncConnector) {
		couchVariablesComposite = new CouchVariablesComposite(container, SWT.V_SCROLL);
		
		GridData couchVarData = new GridData(GridData.FILL_BOTH);
		couchVarData.horizontalSpan = 2;
		
		couchVariablesComposite.setLayoutData(couchVarData);
		
	} else {
		tree = new Tree(container, SWT.SINGLE | SWT.BORDER);
		tree.setHeaderVisible(false);
		GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
		gridData.verticalSpan = 20;
		gridData.horizontalSpan = 2;
		tree.setLayoutData(gridData);		
		tree.addListener(SWT.Selection, new Listener() {
			public void handleEvent(final Event event) {
				TreeItem item = (TreeItem) event.item;
				treeItemName = item.getText();
				String suffix = getBeanName().endsWith(ScHandlerStatement.EVENT_ENTRY_HANDLER) ? 
						ScHandlerStatement.EVENT_ENTRY_HANDLER:
							getBeanName().endsWith(ScHandlerStatement.EVENT_EXIT_HANDLER) ?
									ScHandlerStatement.EVENT_EXIT_HANDLER : "";
				setBeanName("on"+ treeItemName + suffix);
				dialogChanged();
			}
		});
		tree.setVisible(false);
	}
	
	initialize();
	dialogChanged();
	setControl(container);
}
 
Example 19
Project: hadoop-2.6.0-cdh5.4.3   File: ServerView.java   View Source Code Vote up 4 votes
/**
 * Creates the columns for the view
 */
@Override
public void createPartControl(Composite parent) {
  Tree main =
      new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
          | SWT.V_SCROLL);
  main.setHeaderVisible(true);
  main.setLinesVisible(false);
  main.setLayoutData(new GridData(GridData.FILL_BOTH));

  TreeColumn serverCol = new TreeColumn(main, SWT.SINGLE);
  serverCol.setText("Location");
  serverCol.setWidth(300);
  serverCol.setResizable(true);

  TreeColumn locationCol = new TreeColumn(main, SWT.SINGLE);
  locationCol.setText("Master node");
  locationCol.setWidth(185);
  locationCol.setResizable(true);

  TreeColumn stateCol = new TreeColumn(main, SWT.SINGLE);
  stateCol.setText("State");
  stateCol.setWidth(95);
  stateCol.setResizable(true);

  TreeColumn statusCol = new TreeColumn(main, SWT.SINGLE);
  statusCol.setText("Status");
  statusCol.setWidth(300);
  statusCol.setResizable(true);

  viewer = new TreeViewer(main);
  viewer.setContentProvider(this);
  viewer.setLabelProvider(this);
  viewer.setInput(CONTENT_ROOT); // don't care

  getViewSite().setSelectionProvider(viewer);
  
  getViewSite().getActionBars().setGlobalActionHandler(
      ActionFactory.DELETE.getId(), deleteAction);
  getViewSite().getActionBars().getToolBarManager().add(editServerAction);
  getViewSite().getActionBars().getToolBarManager().add(newLocationAction);

  createActions();
  createContextMenu();
}
 
Example 20
Project: hadoop-EAR   File: ServerView.java   View Source Code Vote up 4 votes
/**
 * Creates the columns for the view
 */
@Override
public void createPartControl(Composite parent) {
  Tree main =
      new Tree(parent, SWT.SINGLE | SWT.FULL_SELECTION | SWT.H_SCROLL
          | SWT.V_SCROLL);
  main.setHeaderVisible(true);
  main.setLinesVisible(false);
  main.setLayoutData(new GridData(GridData.FILL_BOTH));

  TreeColumn serverCol = new TreeColumn(main, SWT.SINGLE);
  serverCol.setText("Location");
  serverCol.setWidth(300);
  serverCol.setResizable(true);

  TreeColumn locationCol = new TreeColumn(main, SWT.SINGLE);
  locationCol.setText("Master node");
  locationCol.setWidth(185);
  locationCol.setResizable(true);

  TreeColumn stateCol = new TreeColumn(main, SWT.SINGLE);
  stateCol.setText("State");
  stateCol.setWidth(95);
  stateCol.setResizable(true);

  TreeColumn statusCol = new TreeColumn(main, SWT.SINGLE);
  statusCol.setText("Status");
  statusCol.setWidth(300);
  statusCol.setResizable(true);

  viewer = new TreeViewer(main);
  viewer.setContentProvider(this);
  viewer.setLabelProvider(this);
  viewer.setInput(CONTENT_ROOT); // don't care

  getViewSite().setSelectionProvider(viewer);
  
  getViewSite().getActionBars().setGlobalActionHandler(
      ActionFactory.DELETE.getId(), deleteAction);
  getViewSite().getActionBars().getToolBarManager().add(editServerAction);
  getViewSite().getActionBars().getToolBarManager().add(newLocationAction);

  createActions();
  createContextMenu();
}
 
Example 21
Project: bts   File: MoveObjectAmongProjectDBCollectionSelectionDialog.java   View Source Code Vote up 4 votes
/**
	 * Create contents of the dialog.
	 * @param parent
	 */
	@Override
	protected Control createDialogArea(Composite parent) {
		Composite area = (Composite) super.createDialogArea(parent);
		Composite container = new Composite(area, SWT.NONE);
		container.setLayout(new GridLayout(1, false));
		container.setLayoutData(new GridData(GridData.FILL_BOTH));
		
		Composite composite = new Composite(container, SWT.NONE);
		composite.setLayout(new GridLayout(1, false));
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label lblCurrentProject = new Label(composite, SWT.NONE);
		lblCurrentProject.setText("Current Project");
		
		currentProjectLabeltext = new Text(composite, SWT.BORDER);
		currentProjectLabeltext.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Label lblCurrentDbcollection = new Label(composite, SWT.NONE);
		lblCurrentDbcollection.setText("Current DBCollection");
		
		currentDBCollectionText = new Text(composite, SWT.BORDER);
		currentDBCollectionText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
		
		Composite composite_1 = new Composite(container, SWT.NONE);
		composite_1.setLayout(new GridLayout(1, false));
		composite_1.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		composite_1.setBounds(0, 0, 64, 64);
		
		Label lblChooseTheNew = new Label(composite_1, SWT.NONE);
		lblChooseTheNew.setText("Choose the new Location with Project and Database Collection");
		
		checkboxTreeViewer = new CheckboxTreeViewer(composite_1, SWT.BORDER);
		Tree tree = checkboxTreeViewer.getTree();
		tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
		
//		Button btnMoveRelatedObjects = new Button(composite_1, SWT.CHECK);
//		btnMoveRelatedObjects.setText("Move related objects shown as children of current object aswell.");

		loadInput();
		return area;
	}
 
Example 22
Project: agui_eclipse_plugin   File: FJExportWizardProjectSeletPage.java   View Source Code Vote up 4 votes
/**
 * @see IDialogPage#createControl(Composite)
 */
public void createControl(Composite parent) {
	
	try {
	GridData gd;
	Label label;

	Composite comp = new Composite(parent, SWT.NULL);
	GridLayout layout = new GridLayout();
	comp.setLayout(layout);
	layout.numColumns = 3;
	layout.verticalSpacing = 9;

	label = new Label(comp, SWT.NULL);
	label.setText("Java Project:");
       //
	Tree tree = new Tree(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.CHECK | SWT.V_SCROLL );
	gd = new GridData(GridData.FILL_BOTH);
	gd.heightHint = tree.getItemHeight() * 10;
	tree.setLayoutData(gd);
	projectTree = new CheckboxTreeViewer(tree);
	JavaProjectsTreeContentProvider cp = new JavaProjectsTreeContentProvider();
	projectTree.setContentProvider(cp);
	projectTree.addSelectionChangedListener(new ISelectionChangedListener() {
		public void selectionChanged(SelectionChangedEvent event) {
			dialogChanged();
		}
	});
       //
	label = new Label(comp, SWT.NULL);
	label.setVisible(false);

	initialize();
	projectTree.setCheckedElements(currentSelection);
	dialogChanged();
	setControl(comp);
	}
	catch (Exception e) {
		e.printStackTrace();
	}
}
 
Example 23
Project: agui_eclipse_plugin   File: ProjectSeletPage.java   View Source Code Vote up 4 votes
/**
 * @see IDialogPage#createControl(Composite)
 */
public void createControl(Composite parent) {
    
    try {
    GridData gd;
    Label label;

    Composite comp = new Composite(parent, SWT.NULL);
    GridLayout layout = new GridLayout();
    comp.setLayout(layout);
    layout.numColumns = 2;
    layout.verticalSpacing = 9;

    label = new Label(comp, SWT.NULL);
    label.setText("Java Projects:");
    //
    Tree tree = new Tree(comp, SWT.BORDER | SWT.FULL_SELECTION | SWT.MULTI | SWT.CHECK | SWT.V_SCROLL );
    gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = tree.getItemHeight() * 10;
    tree.setLayoutData(gd);
    projectTree = new CheckboxTreeViewer(tree);
    JavaProjectsTreeContentProvider cp = new JavaProjectsTreeContentProvider();
    projectTree.setContentProvider(cp);
    projectTree.addSelectionChangedListener(new ISelectionChangedListener() {
        public void selectionChanged(SelectionChangedEvent event) {
            dialogChanged();
        }
    });

    initialize();
    StringTree[] sel = new StringTree[preSelection.length];
    for (int i = 0; i < preSelection.length; i++) {
        final String preSel = preSelection[i];
        StringTree root = (StringTree)projectTree.getInput();
        if (root != null) {
            sel[i] = root.findFirst(new StringTree.IStringTreeCondition() {
                public boolean check(StringTree stringTree) {
                    return stringTree.getLabel().equals(preSel);
                }
            });
        }
    }
    projectTree.setCheckedElements(sel);
    dialogChanged();
    setControl(comp);
    }
    catch (Exception e) {
        e.printStackTrace();
    }
}
 
Example 24
Project: AndroidRobot   File: LogAnalysis.java   View Source Code Vote up 4 votes
public void createLogList() {
    tabFolderLogList = new CTabFolder(sashFormLog, SWT.NONE | SWT.BORDER);
    tabFolderLogList.setTabHeight(0);
    tabFolderLogList.marginHeight = 0;
    tabFolderLogList.marginWidth = 0;
    tabFolderLogList.setLayout(new FillLayout());
    tabFolderLogList.setBounds(5, 5, 200, 465);
    tabFolderLogList.setSimple(false);
    tabFolderLogList.setUnselectedCloseVisible(true);

    CTabItem tabItemLogList = new CTabItem(tabFolderLogList, SWT.NONE | SWT.MULTI
                                                             | SWT.V_SCROLL);
    tabFolderLogList.setSelection(tabItemLogList);
    tabItemLogList.setText("日志浏览");

    Composite composite = new Composite(tabFolderLogList, SWT.NONE);
    composite.setLayout(new GridLayout());
    treeLog = new Tree(composite, SWT.BORDER);
    colorBlack = display.getSystemColor(SWT.COLOR_BLACK);

    tabItemLogList.setControl(composite);
    treeLog.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

    treeLog.addListener(SWT.MouseDoubleClick, new Listener() {
        public void handleEvent(Event event) {
            Point point = new Point(event.x, event.y);
            TreeItem item = treeLog.getItem(point);
            if (item != null) {
                String taskName = (String) item.getData("task");
                String loop = String.valueOf(item.getData("loop"));
                String caseName = (String) item.getData("case");
                int index = (Integer) item.getData("index");
                //System.out.println("task:"+taskName+" loop:"+loop+" caseName:"+caseName+" index:"+index);
                if (index != 0)
                    Log.loadLogs(styledTextLog, display, logFile, taskName, loop, caseName,
                        index);
            }
        }
    });

}
 
Example 25
Project: ecard   File: LimitstaendeAnzeigenDialog.java   View Source Code Vote up 4 votes
/**
 * Create contents of the dialog.
 * @param parent
 */
@Override
protected Control createDialogArea(Composite parent){
	setTitle("Limitstände");
	Composite area = (Composite) super.createDialogArea(parent);
	
	Composite compositeFilter = new Composite(area, SWT.NONE);
	compositeFilter.setLayout(new GridLayout(2, false));
	compositeFilter.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	
	Label lblZeitraum = new Label(compositeFilter, SWT.NONE);
	lblZeitraum.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
	lblZeitraum.setBounds(0, 0, 59, 14);
	lblZeitraum.setText("Zeitraum");
	
	comboViewerZeitraum = new ComboViewer(compositeFilter, SWT.NONE);
	Combo comboZeitraum = comboViewerZeitraum.getCombo();
	comboZeitraum.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	comboViewerZeitraum.setLabelProvider(new LimitZeitraumComboLabelProvider());
	comboViewerZeitraum.setContentProvider(ArrayContentProvider.getInstance());
	comboViewerZeitraum.setInput(new int[] {LimitZeitraum.AKTUELLE_PRUEFPERIODE, LimitZeitraum.NACHBRINGFRIST});
	comboViewerZeitraum.setSelection(new StructuredSelection(LimitZeitraum.AKTUELLE_PRUEFPERIODE));
	
	tableTreeViewerLimits = new TreeViewer(area, SWT.BORDER | SWT.FULL_SELECTION);
	Tree tableTreeLimits = tableTreeViewerLimits.getTree();
	tableTreeLimits.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	tableTreeViewerLimits.setContentProvider(new LimitstaendeTreeContentProvider(tableTreeViewerLimits));
	tableTreeViewerLimits.setLabelProvider(new LimitstaendeTreeLabelProvider());
	
	comboViewerZeitraum.addSelectionChangedListener(new ISelectionChangedListener() {
		@Override
		public void selectionChanged(SelectionChangedEvent event){
			lz = (Integer) ((StructuredSelection) event.getSelection()).getFirstElement();
			init();
		}
	});
	
	init();
	
	return area;
}
 
Example 26
Project: cmake-eclipse-helper   File: CMakeMainWizardPage.java   View Source Code Vote up 4 votes
private void createDynamicGroup(Composite parent) {
	Composite c = new Composite(parent, SWT.NONE);
	c.setLayoutData(new GridData(GridData.FILL_BOTH));
	c.setLayout(new GridLayout(2, true));

	Label l1 = new Label(c, SWT.NONE);
	l1.setText("Templates");
	l1.setFont(parent.getFont());
	l1.setLayoutData(new GridData(GridData.BEGINNING));

	rightLabel = new Label(c, SWT.NONE);
	rightLabel.setFont(parent.getFont());
	rightLabel.setText("Description");
	rightLabel.setLayoutData(new GridData(GridData.BEGINNING));

	tree = new Tree(c, SWT.SINGLE | SWT.BORDER);
	tree.setLayoutData(new GridData(GridData.FILL_BOTH));
	tree.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			TreeItem[] tis = tree.getSelection();
			if (tis == null || tis.length == 0)
				return;
			
			String description = (String)tis[0].getData(K_DESC);
			if ( description == null ) {
				description = "";
			}
			choice = tis[0];
			right.setText(description);
			//switchTo((CWizardHandler) tis[0].getData(), (EntryDescriptor) tis[0].getData(DESC));
			setPageComplete(validatePage());
		}
	});
	
	right = new Text(c, SWT.WRAP | SWT.BORDER);
	right.setEditable(false);
	l1.setFont(parent.getFont());
	right.setLayoutData(new GridData(GridData.FILL_BOTH));
	
	loadData();
}
 
Example 27
Project: sophie   File: FilesTree.java   View Source Code Vote up 4 votes
/**
 * Create a new tree listing Solr config files.
 * 
 * @param composite
 *            Parent composite.
 */
public FilesTree(Composite composite) throws SophieException {
    Composite parent = new Composite(composite, SWT.NULL);
    parent.setLayout(new GridLayout(2, true));
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Instantiate Tree.
    tree = new Tree(parent, SWT.BORDER);
    tree.setHeaderVisible(true);
    tree.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Display file in viewer when user double clicks tree item.
    tree.addListener(SWT.MouseDoubleClick, new Listener() {
        @Override
        public void handleEvent(Event event) {
            Point point = new Point(event.x, event.y);
            TreeItem item = tree.getItem(point);
            if (item != null) {
                String fullPath = Objects.toString(item.getData(), "");
                String content;
                if (StringUtils.isEmpty(fullPath)) {
                    content = "This is a directory.";
                } else {
                    try {
                        content = SolrUtils.getFileContent(fullPath);
                    } catch (SophieException e) {
                        content = "Unable to fetch content for " + fullPath + ": " + e.getMessage();
                        Sophie.log.error("Unable to fetch content for " + fullPath, e);
                    }
                }
                styledText.setText(content);
            }
        }
    });

    // Create column.
    columnName = new TreeColumn(tree, SWT.LEFT);
    columnName.setText("File Name");

    // Instantiate viewer.
    styledText = new StyledText(parent, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    styledText.setText("No file selected.");
    styledText.setEditable(false);
    styledText.setLayoutData(new GridData(GridData.FILL_BOTH));

    // Config files are easier to read with a monospaced font.
    Font monospaced = JFaceResources.getFont(JFaceResources.TEXT_FONT);
    styledText.setFont(monospaced);

    // Populate tree with data from Solr.
    populate();

    // Pack columns.
    columnName.pack();
}