本文整理汇总了Java中org.eclipse.swt.SWT.TOP属性的典型用法代码示例。如果您正苦于以下问题:Java SWT.TOP属性的具体用法?Java SWT.TOP怎么用?Java SWT.TOP使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.eclipse.swt.SWT
的用法示例。
在下文中一共展示了SWT.TOP属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createToolBar
public void createToolBar() {
bar = new CoolBar(shell, SWT.FLAT | SWT.TOP);
// bars
bar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
createFileSection();
createEditBar();
createFontSection();
createSettingsBar();
bar.pack();
bar.addListener(SWT.Resize, new Listener() {
@Override
public void handleEvent(Event arg0) {
pmTrans.adjustLayout();
}
});
}
示例2: createDialogArea
@Override
protected Control createDialogArea(Composite parent)
{
Composite dialogArea = (Composite) super.createDialogArea(parent);
Composite composite = new Composite(dialogArea, SWT.NONE);
createMessageArea(composite);
listViewer = new TableViewer(composite, SWT.TOP | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH);
data.widthHint = 400;
data.heightHint = 400;
listViewer.getTable().setLayoutData(data);
listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
listViewer.setContentProvider(new JarProjectContentProvider(null));
listViewer.setComparator(new ViewerComparator());
listViewer.setInput(ResourcesPlugin.getWorkspace());
applyDialogFont(composite);
listViewer.setSelection(new StructuredSelection(initialSelection));
GridLayoutFactory.fillDefaults().generateLayout(composite);
return dialogArea;
}
示例3: getAlignment
public static int getAlignment(String sAlign, int def) {
int align;
if (sAlign == null) {
align = def;
} else if (sAlign.equalsIgnoreCase("center")) {
align = SWT.CENTER;
} else if (sAlign.equalsIgnoreCase("bottom")) {
align = SWT.BOTTOM;
} else if (sAlign.equalsIgnoreCase("top")) {
align = SWT.TOP;
} else if (sAlign.equalsIgnoreCase("left")) {
align = SWT.LEFT;
} else if (sAlign.equalsIgnoreCase("right")) {
align = SWT.RIGHT;
} else {
align = def;
}
return align;
}
示例4: createContentProposalDecoration
/**
* Adds the content proposal field decoration to a given control.
*
* @param control
* The control to decorate
*/
private ControlDecoration createContentProposalDecoration(Control control) {
ControlDecoration decoration = new ControlDecoration(control, SWT.TOP | SWT.LEFT);
decoration.setImage(contentProposalDecorationImage);
decoration.setShowOnlyOnFocus(true);
return decoration;
}
示例5: InterfacesComponent
/**
* Creates a new interfaces component inside the parent composite using the given model.
*
* @param interfacesContainingModel
* A interface containing model
* @param container
* The component container
*/
public InterfacesComponent(InterfacesContainingModel interfacesContainingModel,
WizardComponentContainer container) {
super(container);
this.model = interfacesContainingModel;
Composite parent = getParentComposite();
Label interfacesLabel = new Label(parent, SWT.NONE);
GridData interfacesLabelGridData = fillLabelDefaults();
interfacesLabelGridData.verticalAlignment = SWT.TOP;
interfacesLabel.setLayoutData(interfacesLabelGridData);
interfacesLabel.setText("Interfaces:");
interfacesTable = new Table(parent, SWT.BORDER | SWT.FULL_SELECTION | SWT.VIRTUAL);
interfacesTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
Composite interfacesButtonsComposite = new Composite(parent, SWT.NONE);
interfacesButtonsComposite.setLayoutData(GridDataFactory.fillDefaults().create());
interfacesButtonsComposite.setLayout(GridLayoutFactory.swtDefaults().numColumns(1).margins(0, 0).create());
interfacesAddButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesAddButton.setText("Add...");
interfacesAddButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
interfacesRemoveButton = new Button(interfacesButtonsComposite, SWT.NONE);
interfacesRemoveButton.setText("Remove");
interfacesRemoveButton.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
setupBindings();
}
示例6: createImageHyperlinkToolBarContribution
protected BaseControlContribution createImageHyperlinkToolBarContribution(String id,
final DataModel<?, ?, ?> model, final DataModelElementType modelElementType) {
BaseControlContribution controlContribution = new BaseControlContribution(id) {
@Override
protected Control createControlInternal(Composite parent) {
ImageHyperlink imageHyperlink = new ImageHyperlink(parent, SWT.TOP | SWT.WRAP);
HyperlinkGroup group = new HyperlinkGroup(imageHyperlink.getDisplay());
group.setHyperlinkUnderlineMode(HyperlinkSettings.UNDERLINE_HOVER);
group.add(imageHyperlink);
imageHyperlink.addHyperlinkListener(new HyperlinkAdapter() {
@Override
public void linkActivated(HyperlinkEvent e) {
BaseOpenAction openAction = modelElementType.getOpenAction();
if (openAction != null) {
try {
openAction.runWithObject(model);
}
catch (Exception e1) {
openAction.reportError(e1);
}
}
}
});
ElementTypeDataModelImageHyperlinkView view = new ElementTypeDataModelImageHyperlinkView(model,
imageHyperlink, modelElementType);
view.updateView();
return imageHyperlink;
}
};
return controlContribution;
}
示例7: doRender
@Override
protected void doRender ( final Graphics g, final Rectangle clientRectangle )
{
if ( this.axis == null )
{
return;
}
final Double position = getPosition ();
if ( position == null )
{
return;
}
final int y = (int)this.axis.translateToClient ( clientRectangle.height, getPosition () );
if ( ( this.style & SWT.TOP ) > 0 )
{
g.fillRectangle ( clientRectangle.x, clientRectangle.y, clientRectangle.width, y );
}
else if ( ( this.style & SWT.BOTTOM ) > 0 )
{
g.fillRectangle ( clientRectangle.x, y, clientRectangle.width, clientRectangle.height - y );
}
else
{
if ( y < 0 || y > clientRectangle.width )
{
return;
}
g.drawLine ( clientRectangle.x, clientRectangle.y + y, clientRectangle.width, clientRectangle.y + y );
}
}
示例8: createControl
@Override
public void createControl(Composite parent, FormToolkit toolkit, AvroAttribute<T> element, AvroContext context) {
initialize(element, context);
label = toolkit.createLabel(parent, "", SWT.NONE);
int textStyle = SWT.BORDER;
if (hasConfiguration(AttributeControlConfigurations.TEXT_STYLE)) {
int textStyleConfig = getConfiguration(AttributeControlConfigurations.TEXT_STYLE, Integer.class);
textStyle = textStyle | textStyleConfig;
}
text = toolkit.createText(parent, "", textStyle);
update();
IInputValidator validator = null;
if (hasConfiguration(AttributeControlConfigurations.INPUT_VALIDATOR)) {
InputValidatorProvider inputValidatorProvider =
getConfiguration(AttributeControlConfigurations.INPUT_VALIDATOR, InputValidatorProvider.class);
validator = inputValidatorProvider.getInputValidator(getAttribute().getHolder(), context);
}
if (validator == null) {
validator = new DefaultInputValidtor();
}
IValueChangeListener valueChangeListener = new IValueChangeListener() {
@Override
public void onValueChange(String oldValue, String newValue) {
changeAttribute(parseValue(oldValue), parseValue(newValue));
}
};
new TextValidator(text, SWT.TOP | SWT.LEFT, validator, valueChangeListener);
}
示例9: FilterAdvancedComposite
public FilterAdvancedComposite ( final FilterChangedListener filterChangedListener, final Composite parent, final int style )
{
// fields
super ( parent, style );
// widgets
this.tabFolder = new CTabFolder ( this, SWT.TOP | SWT.BORDER | SWT.CLOSE );
this.addOrConditionButton = creteAddOrConditionButton ();
addOrCondition ();
// layout
final GridLayout layout = new GridLayout ( 1, true );
layout.marginLeft = 6;
layout.marginRight = 6;
layout.marginTop = 6;
layout.marginBottom = 6;
layout.verticalSpacing = 12;
this.setLayout ( layout );
final GridData tabFolderLayoutData = new GridData ();
tabFolderLayoutData.horizontalAlignment = GridData.FILL;
tabFolderLayoutData.grabExcessHorizontalSpace = true;
tabFolderLayoutData.verticalAlignment = GridData.FILL;
tabFolderLayoutData.grabExcessVerticalSpace = true;
this.tabFolder.setLayoutData ( tabFolderLayoutData );
this.tabFolder.setBackgroundMode ( SWT.INHERIT_FORCE );
final GridData addOrConditionButtonLayoutdata = new GridData ();
addOrConditionButtonLayoutdata.horizontalAlignment = GridData.END;
this.addOrConditionButton.setLayoutData ( addOrConditionButtonLayoutdata );
}
示例10: EclipseTabProvider
public EclipseTabProvider ( final Composite parent )
{
this.folder = new CTabFolder ( parent, SWT.TOP | SWT.FLAT | SWT.BORDER );
this.folder.setTabHeight ( 24 );
this.folder.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
this.mgr = new MenuManager ();
final Menu menu = this.mgr.createContextMenu ( this.folder );
this.folder.setMenu ( menu );
}
示例11: ArrayPrimitiveFigure
public ArrayPrimitiveFigure(IArrayModel<IValueModel> model) {
super(model);
this.model = model;
model.registerDisplayObserver((o, indexes) -> observerAction(o, indexes));
N = Math.min(model.getLength(), Constants.ARRAY_LENGTH_LIMIT); // limit size
positions = new ArrayList<>(N);
setBackgroundColor(Constants.Colors.OBJECT);
outerLayout = new GridLayout(3, false);
setLayoutManager(outerLayout);
leftBound = new PositionOutBounds();
rightBound = new PositionOutBounds();
positionsFig = createPositionsFig();
GridData boundConstraints = new GridData(SWT.CENTER, SWT.TOP, false, false);
add(leftBound, boundConstraints);
add(positionsFig);
add(rightBound, boundConstraints);
vars = new HashMap<>();
// for(IArrayIndexModel v : model.getIndexModels())
// addVariable(v);
updateOutOfBoundsPositions();
setSize(getPreferredSize());
}
示例12: createContents
@Override
protected Control createContents(Composite parent)
{
Composite composite = new Composite(parent, SWT.NONE);
initialize();
createDescriptionLabel(composite);
listViewer = new TableViewer(composite, SWT.TOP | SWT.BORDER);
if( !project.isOpen() )
listViewer.getControl().setEnabled(false);
listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
listViewer.setContentProvider(new JarProjectContentProvider(project));
listViewer.setComparator(new ViewerComparator());
listViewer.setInput(project.getWorkspace());
String regName = getPreferenceStore().getString(JPFClasspathPlugin.PREF_REGISTRY_NAME);
if( !regName.isEmpty() )
{
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
listViewer.setSelection(new StructuredSelection(root.getProject(regName)));
}
listViewer.addSelectionChangedListener(new ISelectionChangedListener()
{
@Override
public void selectionChanged(SelectionChangedEvent event)
{
modified = true;
}
});
applyDialogFont(composite);
GridLayoutFactory.fillDefaults().generateLayout(composite);
return composite;
}
示例13: createTestContainerSelectionGroup
private void createTestContainerSelectionGroup (Composite parent) {
Label fTestLabel = new Label(parent, SWT.NONE);
GridData gd = new GridData( );
gd.horizontalAlignment = SWT.RIGHT;
gd.horizontalIndent = 25;
gd.verticalAlignment=SWT.TOP;
fTestLabel.setLayoutData(gd);
fTestLabel.setText(MessageUtil.getString("mainTestExecutionContext"));
fMainTestExecutionComboViewer = new ComboViewer(parent,SWT.DROP_DOWN);
Combo combo = fMainTestExecutionComboViewer.getCombo();
combo.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
fMainTestExecutionComboViewer.setContentProvider(new IStructuredContentProvider(){
@Override
public Object[] getElements(Object inputElement) {
String projectName= (String) inputElement;
loadMainExecutionContextTests(projectName);
return mainExecutionContexts;
}
});
ILabelProvider labelProvider = new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_QUALIFIED);
fMainTestExecutionComboViewer.setLabelProvider(labelProvider);
fMainTestExecutionComboViewer.addSelectionChangedListener(new ISelectionChangedListener() {
@Override
public void selectionChanged(SelectionChangedEvent event) {
fAdditionalTestViewer.setInput(null);
IStructuredSelection selection = (IStructuredSelection) event.getSelection();
if (selection.size() > 0){
resetDoHint();
IType type = (IType) selection.getFirstElement();
fAdditionalTestViewer.setInput(type);
validatePage();
}
}
});
combo.setData(GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4E_LAUNCH_TEST_CONFIGURATION_MAIN_TEST);
}
示例14: createButtonsForButtonBar
@Override
protected void createButtonsForButtonBar(Composite parent) {
parent.setLayout(new GridLayout(1,false));
GridData gridData = new GridData(SWT.FILL, SWT.TOP, true, false, 0, 0);
parent.setLayoutData(gridData);
label=new Label(parent, SWT.None);
label.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, true, false, 0, 0));
label.setText(labelText + " ");
label.setVisible(false);
closeButton = createButton(parent, CLOSE, "Close", false);
closeButton.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
clearTableItemBgColor(debugDataViewer);
if(debugDataViewer != null){
debugDataViewer.setData("SELECTED_ROW_INDEX", null);
debugDataViewer.setData("SEELCTED_COLUMN_INDEX", null);
}
dataViewer.getTablecursor().setVisible(true);
clearStyledTextBgColor(formatedStyledText, textData);
clearStyledTextBgColor(unFormatedStyledText, textData);
close();
}
});
}
示例15: createConsoleBufferWidget
/**
* Create console buffer widget
* @param bufferSize
*/
private void createConsoleBufferWidget(String bufferSize){
HydroGroup hydroGroup = new HydroGroup(this, SWT.NONE);
hydroGroup.setHydroGroupText(Messages.HYDROGRAPH_CONSOLE_PREFERANCE_PAGE_GROUP_NAME);
hydroGroup.setLayout(new GridLayout(1, false));
hydroGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
hydroGroup.getHydroGroupClientArea().setLayout(new GridLayout(2, false));
Label label = new Label(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
label.setText(Messages.PREFERANCE_CONSOLE_BUFFER_SIZE);
textWidget = new Text(hydroGroup.getHydroGroupClientArea(), SWT.BORDER);
textWidget.setText(bufferSize);
textWidget.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
textWidget.setTextLimit(6);
attachConsoleBufferValidator();
Composite purgeComposite = new Composite(hydroGroup.getHydroGroupClientArea(), SWT.NONE);
purgeComposite.setLayout(new GridLayout(2, false));
purgeComposite.setLayoutData(new GridData(SWT.FILL, SWT.TOP, true, false, 2, 1));
Label lblNote = new Label(purgeComposite, SWT.TOP | SWT.WRAP);
lblNote.setText(Messages.PREFERANCE_PAGE_NOTE);
FontData fontData = lblNote.getFont().getFontData()[0];
Font font = new Font(purgeComposite.getDisplay(), new FontData(fontData.getName(), fontData.getHeight(), SWT.BOLD));
lblNote.setFont(font);
Label lblmsg = new Label(purgeComposite, SWT.TOP | SWT.WRAP);
lblmsg.setText(Messages.UI_PERFORMANCE_NOTE_IN_CASE_OF_CHANGE_IN_BUFFER_SIZE);
}