本文整理匯總了Java中org.eclipse.swt.widgets.Control.setLayoutData方法的典型用法代碼示例。如果您正苦於以下問題:Java Control.setLayoutData方法的具體用法?Java Control.setLayoutData怎麽用?Java Control.setLayoutData使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.swt.widgets.Control
的用法示例。
在下文中一共展示了Control.setLayoutData方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDialogArea
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
public Control createDialogArea(Composite parent) {
final Composite main = (Composite)super.createDialogArea(parent);
main.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
try {
if (preamble!=null) {
Label label = new Label(main, SWT.WRAP);
label.setText(preamble);
label.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
}
modelEditor = new ModelViewer<T>();
Control created = modelEditor.createPartControl(main);
created.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
} catch (Exception e) {
logger.error("Cannot create model viewer!", e);
}
return main;
}
示例2: createControl
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent)
{
initializeDialogUnits(parent);
final Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl = createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl = createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control workingSetControl = createWorkingSetControl(composite);
workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl = createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例3: createControl
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
public void createControl(Composite parent) {
sash = new SashForm(parent, SWT.VERTICAL);
IActionBars bars = getSite().getActionBars();
ActionRegistry ar = getActionRegistry();
bars.setGlobalActionHandler(ActionFactory.COPY.getId(), ar.getAction(ActionFactory.COPY.getId()));
bars.setGlobalActionHandler(ActionFactory.PASTE.getId(), ar.getAction(ActionFactory.PASTE.getId()));
OutLineComposite composite = new OutLineComposite(filter, sash, SWT.NONE);
Control tree = getViewer().createControl(composite.getComposite());
tree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 10, 1));
tree.setData(GW_WIDGET_ID,GW_OUTLINE_ELEMENTS_TREE);
getViewer().setEditDomain(getEditDomain());
getViewer().setEditPartFactory(gwtpf);
getViewer().setContents(gWGraph);
getSelectionSynchronizer().addViewer(getViewer());
}
示例4: initializeViewer
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void initializeViewer(IDocument document) {
fAnnotationPreferences = EditorsPlugin.getDefault().getMarkerAnnotationPreferences();
setDocument(document);
installViewerConfiguration();
setEditable(true);
Font font = JFaceResources.getFontRegistry().get(JFaceResources.TEXT_FONT);
getTextWidget().setFont(font);
getTextWidget().setData("document",document);
Control control = getControl();
GridData data = new GridData(GridData.FILL_BOTH);
control.setLayoutData(data);
prependVerifyKeyListener(new VerifyKeyListener() {
@Override
public void verifyKey(VerifyEvent event) {
handleVerifyKeyPressed(event);
}
});
addDocumentListener(document);
}
示例5: createControl
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
final Composite composite= new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl= createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl= createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl= createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例6: createExtensions
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void createExtensions ( final List<ExtensionDescriptor> extensions, final Composite composite, final String location, final boolean horizontal ) throws CoreException
{
int count = 0;
for ( final ExtensionDescriptor extension : extensions )
{
if ( !location.equals ( extension.getLocation () ) )
{
continue;
}
final ViewerExtension viewerExtension = extension.createExtension ();
if ( viewerExtension != null )
{
final Control result = viewerExtension.create ( composite, this, horizontal );
if ( result != null )
{
count++;
final String align = extension.getAlign ();
if ( "END".equalsIgnoreCase ( align ) )
{
result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.END, SWT.FILL, !horizontal, horizontal ) );
}
else if ( "FILL".equalsIgnoreCase ( align ) )
{
result.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, true ) );
}
else
{
result.setLayoutData ( new GridData ( horizontal ? SWT.FILL : SWT.BEGINNING, SWT.FILL, !horizontal, horizontal ) );
}
}
}
}
if ( composite.getLayout () instanceof GridLayout )
{
( (GridLayout)composite.getLayout () ).numColumns = count;
}
}
示例7: createContents
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
protected Control createContents ( final Composite parent )
{
final Composite wrapper = new Composite ( parent, SWT.NONE );
wrapper.setLayout ( new GridLayout ( 1, false ) );
final Control control = super.createContents ( wrapper );
control.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, true, false ) );
createDescription ( wrapper );
return wrapper;
}
示例8: createControl
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
@Override
public void createControl(Composite parent)
{
initializeDialogUnits(parent);
final Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(initGridLayout(new GridLayout(1, false), true));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl = createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control locationControl = createLocationControl(composite);
locationControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control registryControl = registry.createContent(composite);
registryControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control equellaControl = equella.createContent(composite);
equellaControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control workingSetControl = createWorkingSetControl(composite);
workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control infoControl = createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
setControl(composite);
}
示例9: fillComposite
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void fillComposite (Composite composite) {
composite.setLayout(new FormLayout());
viewer = createViewer(composite);
Control control = viewer.getControl();
control.setEnabled(false);
FormData fd_javaScript = new FormData();
fd_javaScript.left = new FormAttachment(0, 10);
fd_javaScript.right = new FormAttachment(100, -5);
fd_javaScript.top = new FormAttachment(0, 10);
setHeight (fd_javaScript, control, 10);
control.setLayoutData(fd_javaScript);
}
示例10: fillComposite
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void fillComposite (Composite composite) {
composite.setLayout(new FormLayout());
viewer = ViewerHelper.createEditor(composite);
viewer.getControl().setData(WIDGET_ID, WIDGET_SCRIPT);
FocusListener listener = new FocusListener() {
@Override
public void focusGained(FocusEvent e) {
}
@Override
public void focusLost(FocusEvent event) {
if (!notification) return;
GW4EVertexEditPartProperties properties = (GW4EVertexEditPartProperties) node.getAdapter(IPropertySource.class);
if (viewer.getDocument() == null) return;
String content = viewer.getDocument().get();
properties.setPropertyValue(ModelProperties.PROPERTY_VERTEX_INIT, content);
}
};
viewer.getControl().addFocusListener(listener);
Control control = viewer.getControl();
control.setEnabled(false);
FormData fd_javaScript = new FormData();
fd_javaScript.left = new FormAttachment(0, 10);
fd_javaScript.right = new FormAttachment(100, -5);
fd_javaScript.top = new FormAttachment(0, 10);
setHeight (fd_javaScript, control, 10);
control.setLayoutData(fd_javaScript);
}
示例11: createDescriptionIn
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
public void createDescriptionIn(Composite composite) {
descriptionBrowser.createControl(composite);
Control c = descriptionBrowser.getControl();
GridData gd = new GridData(GridData.FILL_BOTH);
gd.widthHint = 200;
c.setLayoutData(gd);
}
示例12: setButtonLayoutData
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected void setButtonLayoutData(FontMetrics metrics, Control button,
boolean visible) {
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
int widthHint = Dialog.convertHorizontalDLUsToPixels(metrics,
IDialogConstants.BUTTON_WIDTH);
Point minSize = button.computeSize(SWT.DEFAULT, SWT.DEFAULT, true);
data.widthHint = Math.max(widthHint, minSize.x);
data.exclude = !visible;
button.setLayoutData(data);
}
示例13: applyLayout
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
private void applyLayout ( final Control control )
{
control.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
}
示例14: addPages
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
public void addPages() {
super.addPages();
mainPage = new NewJavaProjectWizardPageOne() {
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite = new Composite(parent, SWT.NULL);
composite.setFont(parent.getFont());
composite.setLayout(new GridLayout(1, false));
composite.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
// create UI elements
Control nameControl = createNameControl(composite);
nameControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control jreControl = createJRESelectionControl(composite);
jreControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
Control workingSetControl = createWorkingSetControl(composite);
workingSetControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
workingSetControl.setVisible(false);
Control infoControl = createInfoControl(composite);
infoControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
infoControl.setVisible(false);
setControl(composite);
}
public IClasspathEntry[] getSourceClasspathEntries() {
return GW4ENature.getSourceClasspathEntries(getProjectName());
}
public IPath getOutputLocation() {
return GW4ENature.getOutputLocation(getProjectName());
}
};
addPage(mainPage);
javaPage = new NewJavaProjectWizardPageTwo(mainPage);
addPage(javaPage);
List<TemplateProvider> templates = TemplateProvider.getTemplates();
fExtraPage = new GW4ETemplatePage(this,templates,false);
addPage(fExtraPage);
fMavenPage = new MavenTemplatePage(this);
addPage(fMavenPage);
}
示例15: fill
import org.eclipse.swt.widgets.Control; //導入方法依賴的package包/類
protected GridData fill(Control control, int span) {
GridData gd = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan = span;
control.setLayoutData(gd);
return gd;
}