org.eclipse.swt.custom.StackLayout Java Examples

The following examples show how to use org.eclipse.swt.custom.StackLayout. 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
Source File: ClassFileEditor.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public void createPartControl(Composite parent) {

	fParent= new Composite(parent, SWT.NONE);
	fStackLayout= new StackLayout();
	fParent.setLayout(fStackLayout);

	fViewerComposite= new Composite(fParent, SWT.NONE);
	fViewerComposite.setLayout(new FillLayout());

	super.createPartControl(fViewerComposite);

	fStackLayout.topControl= fViewerComposite;
	fParent.layout();

	try {
		verifyInput(getEditorInput());
	} catch (CoreException e) {
		String title= JavaEditorMessages.ClassFileEditor_error_title;
		String message= JavaEditorMessages.ClassFileEditor_error_message;
		ExceptionHandler.handle(e, fParent.getShell(), title, message);
	}
}
 
Example #2
Source File: DocumentWizardPage.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
private void createSingleComposite(final Composite parent, final EMFDataBindingContext emfDataBindingContext) {
    singleComposite = new Composite(parent, SWT.NONE);
    singleComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    singleComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 10).create());

    createDocumentTypeRadioButtonComposition(singleComposite, emfDataBindingContext);

    stackedComposite = new Composite(singleComposite, SWT.NONE);
    stackedComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    stack = new StackLayout();
    stackedComposite.setLayout(stack);

    noneCompo = new Composite(stackedComposite, SWT.NONE);
    noneCompo.setLayoutData(GridDataFactory.swtDefaults().grab(false, false).create());

    singleContractComposite = new SingleFileContractInputSelectionComposite(stackedComposite);
    singleContractComposite.bindControl(document, context, emfDataBindingContext);
    createLocalFileComposite(stackedComposite, emfDataBindingContext);
    createExternalURLComposite(stackedComposite, emfDataBindingContext);
}
 
Example #3
Source File: DatabaseConnectorOutputWizardPage.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
@Override
protected Control doCreateControl(final Composite parent,
        final EMFDataBindingContext context) {
    topComposite = new Composite(parent, SWT.NONE);
    topComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
    stackLayout = new StackLayout();
    topComposite.setLayout(stackLayout);

    defaultOutputComposite = createDefaultOuputControl(topComposite, context);
    singleOutputComposite = createSingleOuputControl(topComposite, context);
    oneRowNColsOutputComposite = createOneRowNColsOuputControl(topComposite, context);
    nRowsOneColumOutputComposite = createNRowsOneColumOuputControl(topComposite, context);
    nRowsNColumsOutputComposite = createNRowsNColsOuputControl(topComposite, context);

    updateStackLayout();

    final ConnectorConfiguration configuration = getConnector().getConfiguration();
    final Expression outputTypeExpression = (Expression) getConnectorParameter(configuration, getInput(OUTPUT_TYPE_KEY))
            .getExpression();
    if (outputTypeExpression != null) {
        final IObservableValue outputTypeObservalbe = EMFObservables.observeValue(outputTypeExpression,
                ExpressionPackage.Literals.EXPRESSION__CONTENT);
        outputTypeObservalbe.addValueChangeListener(this);
    }
    return topComposite;
}
 
Example #4
Source File: PageContainer.java    From nebula with Eclipse Public License 2.0 6 votes vote down vote up
public PageContainer(Composite parent, int style) {
	super(parent, style);
	addDisposeListener(e -> PageContainer.this.widgetDisposed(e));
	adapt(this);
	GridLayout layout = new GridLayout(1, false);
	layout.marginWidth = layout.marginHeight = 0;
	setLayout(layout);

	stackLayout = new StackLayout();

	TitleControl title = new TitleControl(this, null);
	adapt(title);
	title.setLayoutData(
			new GridData(GridData.FILL, GridData.BEGINNING, true, false));
	title.setText("SWT MapWidget");

	content = new Composite(this, SWT.NONE);
	content.setLayout(stackLayout);
	content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	adapt(content);
}
 
Example #5
Source File: PyUnitPrefsPage2.java    From Pydev with Eclipse Public License 1.0 6 votes vote down vote up
private void layoutTestRunnerOptions(final StackLayout stackLayout, final int val,
        final Composite contentPanel) {

    switch (val) {
        case TEST_RUNNER_PYDEV:
            stackLayout.topControl = parentPyDev;
            break;

        case TEST_RUNNER_PY_TEST:
            stackLayout.topControl = parentPyTest;
            break;

        case TEST_RUNNER_NOSE:
            stackLayout.topControl = parentNose;
            break;

    }
    contentPanel.layout();
}
 
Example #6
Source File: FormatLayoutPeer.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
final protected void reLayoutSubPages( String customCategoryName )
{
	String category = formatAdapter.getCategory4DisplayName( typeChoicer.getText( ) );

	Control control = categoryPageMaps.get( category );

	( (StackLayout) infoComp.getLayout( ) ).topControl = control;

	infoComp.layout( );

	if ( formatCodeComp != null )
	{
		if ( category.equals( customCategoryName ) )
		{
			( (StackLayout) formatCodeComp.getLayout( ) ).topControl = createHorizontalCustomFormatCodePage( formatCodeComp );
		}
		else
		{
			( (StackLayout) formatCodeComp.getLayout( ) ).topControl = createHorizontalGeneralFormatCodePage( formatCodeComp );
		}
		formatCodeComp.layout( );
	}
}
 
Example #7
Source File: ComponentStatus.java    From arx with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instace
 * @param controller
 * @param parent
 * @param control
 * @param viewRisks
 * @param progressProvider
 */
public ComponentStatus(Controller controller,
                       Composite parent,
                       Control child,
                       ViewRisks<?> view,
                       ComponentStatusLabelProgressProvider progressProvider) {

    this.child = child;
    this.parent = parent;
    this.controller = controller;
    this.view1 = null;
    this.view2 = view;
    
    if (parent.getLayout() == null ||
        !(parent.getLayout() instanceof StackLayout)) {
        throw new RuntimeException("Parent must have a StackLayout"); //$NON-NLS-1$
    }
    
    this.layout = (StackLayout)parent.getLayout();
    this.working = getWorkingComposite(parent, progressProvider);
    this.empty = getEmptyComposite(parent);
    this.layout.topControl = child;
    this.parent.layout(true);
}
 
Example #8
Source File: StandardChartDataSheet.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
@Override
public Composite createDataDragSource( Composite parent )
{
	cmpStack = new Composite( parent, SWT.NONE );
	cmpStack.setLayoutData( new GridData( GridData.FILL_BOTH ) );
	stackLayout = new StackLayout( );
	stackLayout.marginHeight = 0;
	stackLayout.marginWidth = 0;
	cmpStack.setLayout( stackLayout );

	cmpCubeTree = this.createTreeViewComposite( cmpStack );
	cmpDataPreview = this.createTableViewComposite( cmpStack );
	cmpColumnsList = this.createColumnListViewComposite( cmpStack );

	updateDragDataSource( );
	return cmpStack;
}
 
Example #9
Source File: ComponentStatus.java    From arx with Apache License 2.0 6 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param controller
 * @param parent
 * @param child
 * @param view
 * @param provider
 */
public ComponentStatus(Controller controller, 
                       Composite parent, 
                       Control child,
                       ViewStatistics<?> view,
                       ComponentStatusLabelProgressProvider progressProvider){
    
    this.child = child;
    this.parent = parent;
    this.controller = controller;
    this.view1 = view;
    this.view2 = null;
    
    if (parent.getLayout() == null ||
        !(parent.getLayout() instanceof StackLayout)) {
        throw new RuntimeException("Parent must have a StackLayout"); //$NON-NLS-1$
    }
    
    this.layout = (StackLayout)parent.getLayout();
    this.working = getWorkingComposite(parent, progressProvider);
    this.empty = getEmptyComposite(parent);
    this.layout.topControl = child;
    this.parent.layout(true);
}
 
Example #10
Source File: SettingsDialog.java    From slr-toolkit with Eclipse Public License 1.0 6 votes vote down vote up
private void createCenter() {
	
	stackComposite = new Composite(shell, SWT.NONE);
	stackComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	sl_stackComposite = new StackLayout();
	stackComposite.setLayout(sl_stackComposite);
	
	pageBarChart = new Composite (stackComposite, SWT.NONE);
	pageBubbleChart = new Composite (stackComposite, SWT.NONE);
	pagePieChart = new Composite (stackComposite, SWT.NONE);
	
	pageBarChart.setLayout(new FillLayout());
	
	buildBarSettings();
	buildBubbleSettings();
	buildPieSettings();
	
}
 
Example #11
Source File: JsonEditor.java    From KaiZen-OpenAPI-Editor with Eclipse Public License 1.0 6 votes vote down vote up
@Override
protected ISourceViewer createSourceViewer(Composite parent, IVerticalRuler ruler, int styles) {
    Composite composite = new Composite(parent, SWT.NONE);
    GridLayout compositeLayout = new GridLayout(1, false);
    compositeLayout.marginHeight = 0;
    compositeLayout.marginWidth = 0;
    compositeLayout.horizontalSpacing = 0;
    compositeLayout.verticalSpacing = 0;
    composite.setLayout(compositeLayout);

    topPanel = new Composite(composite, SWT.NONE);
    topPanel.setLayout(new StackLayout());
    topPanel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false));

    Composite editorComposite = new Composite(composite, SWT.NONE);
    editorComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
    FillLayout fillLayout = new FillLayout(SWT.VERTICAL);
    fillLayout.marginHeight = 0;
    fillLayout.marginWidth = 0;
    fillLayout.spacing = 0;
    editorComposite.setLayout(fillLayout);

    ISourceViewer result = doCreateSourceViewer(editorComposite, ruler, styles);

    return result;
}
 
Example #12
Source File: RepeatTestDataSettingDialog.java    From ermaster-b with Apache License 2.0 6 votes vote down vote up
private void initCardPanel(Composite composite) {
	this.cardPanel = new Composite(composite, SWT.NONE);

	this.stackLayout = new StackLayout();
	this.stackLayout.marginHeight = 0;
	this.stackLayout.marginWidth = 0;

	this.cardPanel.setLayout(this.stackLayout);

	GridData gridData = new GridData();
	gridData.grabExcessHorizontalSpace = true;
	gridData.horizontalAlignment = GridData.FILL;
	gridData.horizontalSpan = 2;
	gridData.horizontalIndent = 0;
	gridData.verticalIndent = 0;
	this.cardPanel.setLayoutData(gridData);

	this.initNonePanel();
	this.initTemplatePanel();
	this.initForeignKeyPanel();
	this.initEnumPanel();
}
 
Example #13
Source File: RepeatTestDataSettingDialog.java    From ermasterr with Apache License 2.0 6 votes vote down vote up
private void initCardPanel(final Composite composite) {
    cardPanel = new Composite(composite, SWT.NONE);

    stackLayout = new StackLayout();
    stackLayout.marginHeight = 0;
    stackLayout.marginWidth = 0;

    cardPanel.setLayout(stackLayout);

    final GridData gridData = new GridData();
    gridData.grabExcessHorizontalSpace = true;
    gridData.horizontalAlignment = GridData.FILL;
    gridData.horizontalSpan = 2;
    gridData.horizontalIndent = 0;
    gridData.verticalIndent = 0;
    cardPanel.setLayoutData(gridData);

    initNonePanel();
    initTemplatePanel();
    initForeignKeyPanel();
    initEnumPanel();
}
 
Example #14
Source File: ApiDocumentationView.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
public void showResult(ApiDocumentationResultView view) {
	Composite composite = view.getComposite();

	resultsVerticalList.add(composite);

	StackLayout layout = (StackLayout) getComposite().getLayout();
	layout.topControl = resultsScrolledComposite;

	view.getComposite().addDisposeListener(new DisposeListener() {

		@Override
		public void widgetDisposed(DisposeEvent e) {
			if (resultsVerticalList.getChildren().length == 0)
				layout.topControl = defaultMessageComposite;
		}
	});
}
 
Example #15
Source File: ProcessWizard.java    From olca-app with Mozilla Public License 2.0 6 votes vote down vote up
@Override
protected void createContents(Composite comp) {
	createWasteCheck(comp);
	createRefFlowCheck(comp);
	qRefLabel = UI.formLabel(comp, M.QuantitativeReference);
	flowText = UI.formText(comp, SWT.NONE);
	createLabelStack(comp);
	contentStack = new Composite(comp, SWT.NONE);
	UI.gridData(contentStack, true, true).heightHint = 200;
	contentStack.setLayout(new StackLayout());
	createFlowTree();
	createPropertyViewer();
	((StackLayout) labelStack.getLayout()).topControl = selectProductLabel;
	((StackLayout) contentStack.getLayout()).topControl = productTreeContainer;
	labelStack.layout();
	contentStack.layout();
	if (refFlow != null) {
		FlowDescriptor d = Descriptor.of(refFlow);
		INavigationElement<?> e = Navigator.findElement(d);
		ISelection s = new StructuredSelection(e);
		flowTree.setSelection(s, true);
		String name = refFlow.name != null ? refFlow.name : "";
		nameText.setText(name);
	}
}
 
Example #16
Source File: AZProgressBar.java    From BiglyBT with GNU General Public License v2.0 6 votes vote down vote up
/**
 *
 * @param parent
 * @param isIndeterminate
 * @param useInputButton determines whether the <code>inputButton</code> is available or not
 * @param image an <code>Image</code> to display; may be null
 */
public AZProgressBar(Composite parent, boolean isIndeterminate) {
	super(parent, SWT.NULL);

	incrementalProgressBar = new ProgressBar(this, SWT.HORIZONTAL);
	indeterminateProgressBar = new ProgressBar(this, SWT.HORIZONTAL
			| SWT.INDETERMINATE);

	stack = new StackLayout();
	setLayout(stack);
	pack();

	visible = super.isVisible();
	
	setIndeterminate(isIndeterminate);
}
 
Example #17
Source File: CodeRecommendationView.java    From scava with Eclipse Public License 2.0 6 votes vote down vote up
public void showPreview(CodeRecommendationPreviewView view) {
	view.getComposite().setParent(previewComposite);

	StackLayout layout = (StackLayout) previewComposite.getLayout();
	layout.topControl = view.getComposite();

	view.getComposite().addDisposeListener(new DisposeListener() {

		@Override
		public void widgetDisposed(DisposeEvent e) {
			layout.topControl = lblSelectAPattern;
		}
	});

	Display.getDefault().syncExec(() -> {
		previewComposite.pack();
		previewComposite.requestLayout();
	});
}
 
Example #18
Source File: ComponentResponsiveLayout.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Primary will be shown as long as width and height are within the given bounds,
 * otherwise the composite will switch to the secondary control
 * 
 * @param parent
 * @param minWidth
 * @param minHeight
 */
public ComponentResponsiveLayout(final Composite parent, 
                                 final int minWidth, 
                                 final int minHeight,
                                 final Control primary,
                                 final Control secondary) {
    final StackLayout layout = new StackLayout();
    parent.setLayout (layout);
    layout.topControl = primary;
    parent.layout();
    parent.addControlListener(new ControlAdapter(){

        @Override
        public void controlResized(ControlEvent arg0) {

            if (parent.getSize().x < minWidth || parent.getSize().y < minHeight) {
                if (layout.topControl != secondary) {
                    layout.topControl = secondary;
                    parent.layout();
                }
            } else {
                if (layout.topControl != primary) {
                    layout.topControl = primary;
                    parent.layout();
                }
            }
        }
    });
}
 
Example #19
Source File: UncertaintyDialog.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void createCompositeStack(Composite parent) {
	Composite stack = toolkit.createComposite(parent);
	UI.gridData(stack, true, true);
	stackLayout = new StackLayout();
	stack.setLayout(stackLayout);
	var types = UncertaintyType.values();
	clients = new UncertaintyPanel[types.length];
	for (int i = 0; i < types.length; i++) {
		Composite comp = toolkit.createComposite(stack);
		UI.gridLayout(comp, 2);
		UncertaintyPanel client = new UncertaintyPanel(comp, types[i]);
		clients[i] = client;
	}
}
 
Example #20
Source File: ProcessWizard.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void createLabelStack(Composite container) {
	labelStack = new Composite(container, SWT.NONE);
	labelStack
			.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false));
	labelStack.setLayout(new StackLayout());
	selectProductLabel = new Label(labelStack, SWT.NONE);
	selectFlowPropertyLabel = new Label(labelStack, SWT.NONE);
	selectFlowPropertyLabel.setText(M.ReferenceFlowProperty);
}
 
Example #21
Source File: IterationPropertySection.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void createContent(final Composite parent) {
    context = new EMFDataBindingContext();
    final TabbedPropertySheetWidgetFactory widgetFactory = getWidgetFactory();

    final Composite composite = widgetFactory.createPlainComposite(parent, SWT.NONE);
    composite.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).margins(10, 5).create());
    composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());

    final SelectObservableValue recurrenceTypeObservable = createRecurrenceTypeRadioGroup(composite, widgetFactory);

    final Composite stackedComposite = widgetFactory.createPlainComposite(composite, SWT.NONE);
    stackedComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    final StackLayout stackLayout = new StackLayout();
    stackedComposite.setLayout(stackLayout);

    final Composite noneComposite = widgetFactory.createComposite(stackedComposite, SWT.NONE);
    final Composite standardLoopContent = createStandardLoopContent(stackedComposite, widgetFactory);
    final Composite multiInstanceContent = createMultiInstanceContent(stackedComposite, widgetFactory);
    recurrenceTypeObservable.addValueChangeListener(new IValueChangeListener() {

        @Override
        public void handleValueChange(final ValueChangeEvent event) {
            final MultiInstanceType type = (MultiInstanceType) event.diff.getNewValue();
            switch (type) {
                case NONE:
                    stackLayout.topControl = noneComposite;
                    break;
                case STANDARD:
                    stackLayout.topControl = standardLoopContent;
                    break;
                default:
                    stackLayout.topControl = multiInstanceContent;
                    break;
            }
            stackedComposite.layout();
        }
    });

}
 
Example #22
Source File: ParameterWizard.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void setLayout(Layout layout) {
	if (!(layout instanceof StackLayout))
		throw new UnsupportedOperationException(
				"Only supported for StackLayout");
	super.setLayout(layout);
}
 
Example #23
Source File: CalculationWizardPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
private void updateOptions() {
	StackLayout layout = (StackLayout) optionStack.getLayout();
	if (setup.calcType == CalculationType.MONTE_CARLO_SIMULATION) {
		layout.topControl = monteCarloOptions;
	} else {
		layout.topControl = commonOptions;
	}
	optionStack.layout();
	getContainer().updateButtons();
}
 
Example #24
Source File: CalculationWizardPage.java    From olca-app with Mozilla Public License 2.0 5 votes vote down vote up
@Override
public void createControl(Composite parent) {
	Composite body = new Composite(parent, SWT.NULL);
	UI.gridLayout(body, 2, 10, 10);
	setControl(body);

	// main selectors
	createParamSetCombo(body);
	createAllocationCombo(body);
	createMethodCombo(body);
	createNWSetCombo(body);
	createTypeRadios(body);

	// separator
	new Label(body, SWT.NONE);
	UI.gridData(new Label(
			body, SWT.SEPARATOR | SWT.HORIZONTAL),
			true, false);
	new Label(body, SWT.NONE);

	// options
	optionStack = new Composite(body, SWT.NULL);
	StackLayout optionsLayout = new StackLayout();
	optionStack.setLayout(optionsLayout);
	createMonteCarloOptions(optionStack);
	createCommonOptions(optionStack);
	optionsLayout.topControl = commonOptions;
	new Label(body, SWT.NONE);

	updateOptions();
}
 
Example #25
Source File: ComponentMultiStack.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new entry
 * @param layoutData
 * @return
 */
public Composite create(Object layoutData) {
    
    StackLayout layout = new StackLayout();
    Composite composite = new Composite(base, SWT.NONE);
    composite.setLayoutData(layoutData);
    composite.setLayout(layout);
    stacks.add(composite);
    layouts.add(layout);
    return composite;
}
 
Example #26
Source File: ComponentMultiStack.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Sets the layer
 * @param layer
 */
public void setLayer(int layer) {
    for (int i=0; i<layouts.size(); i++) {
        StackLayout layout = layouts.get(i);
        if (layer < 0 || layer > children.get(layout).size()) {
            throw new IllegalArgumentException("Layout out of range");
        }
        layout.topControl = this.children.get(layout).get(layer);
    }
    for (Composite c : stacks) {
        c.layout();
    }
}
 
Example #27
Source File: ViewRisks.java    From arx with Apache License 2.0 5 votes vote down vote up
/**
 * Creates a new instance.
 *
 * @param parent
 * @param controller
 * @param target
 * @param reset
 */
public ViewRisks( final Composite parent,
                  final Controller controller,
                  final ModelPart target,
                  final ModelPart reset) {

    // Register
    controller.addListener(ModelPart.MODEL, this);
    controller.addListener(ModelPart.INPUT, this);
    controller.addListener(ModelPart.SELECTED_PERSPECTIVE, this);
    controller.addListener(ModelPart.SELECTED_VIEW_CONFIG, this);
    controller.addListener(ModelPart.SELECTED_RISK_VISUALIZATION, this);
    
    controller.addListener(target, this);
    if (reset != null) {
        controller.addListener(reset, this);
    }
    
    // Remember
    this.controller = controller;
    this.reset = reset;
    this.target = target;

    // Create controls
    parent.setLayout(new StackLayout());
    Control control = this.createControl(parent);

    // Update status
    this.status = new ComponentStatus(controller,
                                      parent, 
                                      control,
                                      this,
                                      getProgressProvider());
    
    // Reset
    this.reset();
}
 
Example #28
Source File: EigenartikelDetailDisplay.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * @wbp.parser.entryPoint
 */
@Override
public Composite createDisplay(Composite parent, IViewSite site){
	this.site = site;
	
	container = new Composite(parent, SWT.NONE);
	// 		parent.setLayoutData(new GridData(GridData.FILL_BOTH));
		layout = new StackLayout();
		container.setLayout(layout);
	
	compProduct = new Composite(container, SWT.None);		
	compProduct.setLayout(new GridLayout(1, false));
	
	ToolBar toolBar = new ToolBar(compProduct, SWT.BORDER | SWT.FLAT | SWT.RIGHT);
	toolBar.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
	final ToolBarManager manager = new ToolBarManager(toolBar);
	manager.add(createAction);
	if (LocalLockServiceHolder.get().getStatus() != Status.STANDALONE) {
		manager.add(toggleLockAction);
	}
	manager.add(deleteAction);
	manager.update(true);
	toolBar.pack();
	
	epc = new EigenartikelProductComposite(compProduct, SWT.None);
	epc.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	epc.setUnlocked(LocalLockServiceHolder.get().getStatus() == Status.STANDALONE);
	
	compArticle = new Composite(container, SWT.None);		
	compArticle.setLayout(new GridLayout(1, false));
	
	ec = new EigenartikelComposite(compArticle, SWT.None, false, null);
	ec.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	ec.setUnlocked(LocalLockServiceHolder.get().getStatus() == Status.STANDALONE);
	
	layout.topControl = compProduct;
	container.layout();
	
	return container;
}
 
Example #29
Source File: MedicationComposite.java    From elexis-3-core with Eclipse Public License 1.0 5 votes vote down vote up
private void medicationTableComposite(IWorkbenchPartSite partSite){
	tablesComposite = new Composite(this, SWT.NONE);
	tablesComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	tablesLayout = new StackLayout();
	tablesComposite.setLayout(tablesLayout);
	
	medicationTableComposite =
		new MedicationTableComposite(tablesComposite, SWT.NONE | SWT.VIRTUAL);
	medicationTableComposite.setMedicationComposite(this);
	MedicationViewerHelper.addContextMenu(medicationTableComposite.getTableViewer(), this,
		partSite);
	// this composite manages selection of both tables
	medicationTableComposite.getTableViewer().addSelectionChangedListener(this);
	
	medicationHistoryTableComposite =
		new MedicationHistoryTableComposite(tablesComposite, SWT.NONE | SWT.VIRTUAL);
	medicationHistoryTableComposite.setMedicationComposite(this);
	MedicationViewerHelper.addContextMenu(medicationHistoryTableComposite.getTableViewer(),
		this, partSite);
	// this composite manages selection of both tables
	medicationHistoryTableComposite.getTableViewer().addSelectionChangedListener(this);
	medicationHistoryFilter =
		new MedicationFilter(medicationHistoryTableComposite.getTableViewer());
	medicationHistoryTableComposite.getTableViewer().addFilter(medicationHistoryFilter);
	
	tablesLayout.topControl = medicationTableComposite;
}
 
Example #30
Source File: DocumentWizardPage.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
@Override
public void createControl(final Composite parent) {
    final EMFDataBindingContext emfDataBindingContext = new EMFDataBindingContext();
    final Composite mainComposite = new Composite(parent, SWT.NONE);
    mainComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
    mainComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).create());

    new DocumentNameComposite(mainComposite).bindControl(document, context, emfDataBindingContext);
    new DocumentDescriptionComposite(mainComposite).bindControl(document, emfDataBindingContext);

    createSingleMultipleRadioGroup(mainComposite, emfDataBindingContext);

    final Group initialContentGroup = createInitialContentGroup(mainComposite);
    final Composite stackComposite = new Composite(initialContentGroup, SWT.NONE);
    stackComposite.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).span(2, 1).create());

    singleMultiplestack = new StackLayout();
    stackComposite.setLayout(singleMultiplestack);
    createSingleComposite(stackComposite, emfDataBindingContext);
    createMultipleComposite(stackComposite, emfDataBindingContext);
    createMimeType(initialContentGroup, emfDataBindingContext);
    updateMimeTypeStack();
    updateSingleMultipleStack(document.isMultiple());
    updateStack(document.getDocumentType());
    WizardPageSupport.create(this, emfDataBindingContext);
    setControl(mainComposite);
}