当前位置: 首页>>代码示例>>Java>>正文


Java ToolBar.setLayoutData方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.ToolBar.setLayoutData方法的典型用法代码示例。如果您正苦于以下问题:Java ToolBar.setLayoutData方法的具体用法?Java ToolBar.setLayoutData怎么用?Java ToolBar.setLayoutData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.ToolBar的用法示例。


在下文中一共展示了ToolBar.setLayoutData方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createContent

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private void createContent() {
    toolBar = new ToolBar(this, SWT.HORIZONTAL);
    toolBar.setEnabled(false);
    GridLayout layout = new GridLayout();
    GridData layoutData = new GridData(SWT.FILL, SWT.TOP, true, false);
    toolBar.setLayout(layout);
    toolBar.setLayoutData(layoutData);

    ToolItem cancelProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
    cancelProcessToolItem.setText(resourceBundle.getString("cancel_process"));
    cancelProcessToolItem.addListener(SWT.Selection, event -> {
        listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewCancelProcessToolItemClicked);
    });

    ToolItem terminateProcessToolItem = new ToolItem(toolBar, SWT.PUSH);
    terminateProcessToolItem.setText(resourceBundle.getString("kill_process"));
    terminateProcessToolItem.addListener(SWT.Selection, event -> {
        listeners.forEach(DBProcessInfoViewListener::dbProcessInfoViewTerminateProcessToolItemClicked);
    });

    processInfoText = new Text(this, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP | SWT.V_SCROLL);
    GridData textLayoutData = new GridData(SWT.FILL, SWT.BOTTOM, true, false);
    textLayoutData.heightHint = 200;
    processInfoText.setLayoutData(textLayoutData);
}
 
开发者ID:technology16,项目名称:pgsqlblocks,代码行数:26,代码来源:DBProcessInfoView.java

示例2: createComposites

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private void createComposites(Composite parent) {
	ToolBar toolBar = new ToolBar(parent, SWT.VERTICAL | SWT.FLAT | SWT.WRAP);
	toolBar.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true , true));
	
	Composite option = new Composite(parent,SWT.NONE);
	option.setLayout(new FormLayout());
	
	initOptions(toolBar,option);
	
	Point optionSize = computeOptionsSize(0 , toolBar.computeSize(SWT.DEFAULT,SWT.DEFAULT).y );
	option.setLayoutData(new GridData(optionSize.x,optionSize.y));
	
	if( this.options.size() > 0 ){
		select((Option)this.options.get(0));
	}
}
 
开发者ID:theokyr,项目名称:TuxGuitar-1.3.1-fork,代码行数:17,代码来源:TGSettingsEditor.java

示例3: DataMappingComposite

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
public DataMappingComposite(Composite parent, int style)
{
  super(parent, style);
  
  GridLayout layout = new GridLayout(2, false);
  layout.horizontalSpacing = 0;
  layout.verticalSpacing = 0;
  layout.marginWidth = 0;
  layout.marginHeight = 0;
  this.setLayout(layout);
  
  text = new StyledText(this, SWT.BORDER);
  text.setBackground(getGrey());
  text.setEnabled(false);
  text.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
  text.setTopMargin(2);
  
  ToolBar toolBar = new ToolBar(this, SWT.HORIZONTAL);
  toolBar.setLayoutData(new GridData(SWT.RIGHT, SWT.FILL, false, false, 1, 1));
  btnAttributeBrowser = new ToolItem(toolBar, SWT.NONE);
  btnAttributeBrowser.setImage(IconFactory.get(parent.getDisplay()).getAttribute16());
}
 
开发者ID:ivy-supplements,项目名称:bpm-beans,代码行数:23,代码来源:DataMappingComposite.java

示例4: setupOptions

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private Composite setupOptions(Composite parent) {
  Composite result = new Composite(parent, SWT.NONE);
  GridLayout layout = Widgets.buildContainerLayout(1);

  Composite leftCmds = createCommands(result);
  if (null != leftCmds) {
    leftCmds.setLayoutData(Widgets.buildHorzFillData());
    layout.numColumns = 2;
  }
  result.setLayout(layout);

  ToolBar rightOptions = createToolBar(result);
  rightOptions.setLayoutData(Widgets.buildTrailFillData());

  return result;
}
 
开发者ID:google,项目名称:depan,代码行数:17,代码来源:GraphNodeViewer.java

示例5: createToolBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
/**
 * Crate the toolbar 
 * @param parent the container of the toolbar
 */
protected void createToolBar(Composite parent){
	
	ToolBar toolBar = new ToolBar (parent, SWT.FLAT);
	createStyle = new ToolItem (toolBar, SWT.PUSH);
	createStyle.setImage (getTabImage());
	createStyle.setToolTipText(Messages.TextStyleView_createToolTip);
	createStyle.addSelectionListener(new SelectionAdapter() {
    	@Override
    	public void widgetSelected(SelectionEvent e) {
    		doCreate();
    	}
	});
	
	GridData toolButtonData = new GridData();
	toolButtonData.horizontalAlignment = SWT.END;
	toolBar.setLayoutData(toolButtonData);
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:22,代码来源:TextStyleView.java

示例6: TFContainer

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
public TFContainer(Composite parent, int style) {
	super(parent, style);
	GridLayout layout = new GridLayout(2,false);
	layout.marginHeight = 0;
	layout.marginWidth = 0;
	layout.verticalSpacing = 0;
	setLayout(layout);

	toolBar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
	
	additionalToolbar = new ToolBar(this, SWT.HORIZONTAL | SWT.FLAT | SWT.WRAP | SWT.RIGHT);
	GridData additionalToolbarGD = new GridData(SWT.RIGHT, SWT.CENTER, true, false);
	additionalToolbar.setLayoutData(additionalToolbarGD);
	additionalToolbarManager = new ToolBarManager(additionalToolbar);
	
	content = new Composite(this, SWT.NONE);
	stackLayout = new StackLayout();
	stackLayout.marginWidth = 0;
	stackLayout.marginHeight = 0;
	content.setLayout(stackLayout);
	content.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
}
 
开发者ID:OpenSoftwareSolutions,项目名称:PDFReporter-Studio,代码行数:23,代码来源:TFContainer.java

示例7: createUI

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
public void createUI(Composite parent) {
	ToolBar tbMonitor = new ToolBar(parent, SWT.FLAT | SWT.RIGHT | SWT.VERTICAL);
	tbMonitor.setLayoutData(new GridData(SWT.LEFT, SWT.FILL, false, true, 1, 1));

	fClearOnStart = createButton(tbMonitor, Action.CLEARONSTART, "Clear on session start (port opened or RTS pin twitched)", "terminal-clear");
	createButton(tbMonitor, Action.CLEAR, "Clear", "eraser");

	// ToolItem save = createButton(tbMonitor, Action.SAVE,
	// "Save content to file...", "disk");
	// save.setEnabled(false);

	createButton(tbMonitor, Action.HOME, "Scroll to home", "atop");
	ToolItem se = createButton(tbMonitor, Action.END, "Scroll to end", "abottom");

	eMonitor = new StyledText(parent, SWT.READ_ONLY | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI);
	eMonitor.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));

	eMonitor.setRightMargin(3);
	eMonitor.setBottomMargin(3);
	eMonitor.setTopMargin(3);
	eMonitor.setLeftMargin(3);
	eMonitor.setText("Embed plugin serial terminal\r\n");

	se.setSelection(true);
	doMonitorAction(Action.END, true);
}
 
开发者ID:ploys,项目名称:ecle,代码行数:27,代码来源:PortMonitor.java

示例8: createNavigationBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private void createNavigationBar(Composite parent) {
	toolBarManager = new ToolBarManager(SWT.FLAT);
	// toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false)
			.create());

	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:26,代码来源:WebBrowserViewer4Mac.java

示例9: createNavigationBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private void createNavigationBar(Composite parent)
{
	toolBarManager = new ToolBarManager(SWT.FLAT);
	toolBarManager.add(consoleAction);
	toolBarManager.add(backAction);
	toolBarManager.add(forwardAction);
	toolBarManager.add(stopAction);
	toolBarManager.add(refreshAction);
	ToolBar toolbar = toolBarManager.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());

	urlCombo = new Combo(parent, SWT.DROP_DOWN);
	urlCombo.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
	urlCombo.addListener(SWT.DefaultSelection, new Listener() {
		
		@Override
		public void handleEvent(Event e) {
			setURL(urlCombo.getText());
		}
	});

	ToolBarManager toolBarManager2 = new ToolBarManager(SWT.FLAT);
	toolBarManager2.add(goAction);
	toolbar = toolBarManager2.createControl(parent);
	toolbar.setLayoutData(GridDataFactory.fillDefaults().create());
}
 
开发者ID:apicloudcom,项目名称:APICloud-Studio,代码行数:27,代码来源:WebBrowserViewer.java

示例10: createContents

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
@Override
protected Control createContents(Composite parent) {
  Composite c = new Composite(parent, SWT.BORDER);

  GridLayout gridLayout = new GridLayout(1, false);
  gridLayout.marginWidth = 0;
  gridLayout.marginHeight = 0;
  gridLayout.horizontalSpacing = 0;
  gridLayout.verticalSpacing = 0;
  c.setLayout(gridLayout);

  GridData gd = new GridData(GridData.FILL_HORIZONTAL);
  c.setLayoutData(gd);

  ToolBarManager toolBarManager = new ToolBarManager(SWT.FLAT);
  toolBarManager.add(new OpenFilesAction(this));
  toolBarManager.add(new ScreenshotAction(this, false));
  toolBarManager.add(new ScreenshotAction(this, true));
  toolBarManager.add(new SaveScreenShotAction(this));
  ToolBar tb = toolBarManager.createControl(c);
  tb.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

  mUiAutomatorView = new UiAutomatorView(c, SWT.BORDER);
  mUiAutomatorView.setLayoutData(new GridData(GridData.FILL_BOTH));

  return parent;
}
 
开发者ID:DroidTesting,项目名称:android-uiautomatorviewer,代码行数:28,代码来源:UiAutomatorViewer.java

示例11: createToolBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
/**
 * Creates the toolbar.
 */
private void createToolBar(Composite composite, Object layoutData) {
	toolBar = new ToolBar(composite, SWT.FLAT);
	toolBar.addListener(SWT.KeyUp, createToolbarCommandHandler());
	if (layoutData != null) toolBar.setLayoutData(layoutData);
	
	if (nativeFilter != null) {
		nativeFilterAdapter = (FilterAdapter) nativeFilterAdapterMap.get(nativeFilter.getClass());
		if (nativeFilterAdapter != null) {
			nativeToolItem = nativeFilterAdapter.create(toolBar);
			nativeToolItem.setSelection(true);
		} 
	}
	hexDumpToolItem = createHexDumpToolItem();
	if (nativeFilterAdapter == null) {
		// Default button changes for these instances.
		hexDumpToolItem.setSelection(true);
		// Prevent NullPointerExceptions if the nativeFilterAdapter does not apply.
		nativeFilterAdapter = hexFilterAdapter;
	}
	rawDumpToolItem = createRawDumpToolItem();
	new ToolItem(toolBar, SWT.SEPARATOR);
	copyToolItem = createCopyToolItem();
	new ToolItem(toolBar, SWT.SEPARATOR);
	createPrintToolItem();
	toolBar.pack();
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:30,代码来源:FileViewerWindow.java

示例12: BookButtonBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
BookButtonBar(Composite parent, int gridStyle) {
    toolbar = new ToolBar(parent, SWT.FLAT | SWT.NO_FOCUS);
    gd = new GridData(gridStyle);
    toolbar.setLayoutData(gd);

    for (Command cmd : cmds) {
        addIconButton(toolbar, cmd);
    }
    BookNotifier.getInstance().addListener(this);
    refresh();
}
 
开发者ID:openaudible,项目名称:openaudible,代码行数:12,代码来源:BookButtonBar.java

示例13: createToolBar

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
protected ToolBarManager createToolBar(Composite parent, int style) {
	ToolBarManager toolbarManager = new ToolBarManager(style);
	
	int gridDataStyle = isBeginning(style) ? GridData.HORIZONTAL_ALIGN_BEGINNING : GridData.HORIZONTAL_ALIGN_END;
	
       ToolBar toolbar = toolbarManager.createControl(parent);
       GridData toolbarLayoutdata = new GridData(gridDataStyle);
       toolbarLayoutdata.heightHint = 25;
       toolbar.setLayoutData(toolbarLayoutdata);
       
	return toolbarManager;
}
 
开发者ID:Talend,项目名称:avro-schema-editor,代码行数:13,代码来源:SchemaViewer.java

示例14: createContent

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
/**
 * Creates the main content for the PlotEditor's UI. This includes a ToolBar
 * above the plot's drawing.
 * <p>
 * <b>Note:</b> This method lays out the specified parent composite and thus
 * does not return any values.
 * </p>
 * 
 * @param parent
 *            The parent Composite to contain the UI.
 */
private void createContent(Composite parent) {

	// Set up the layout of the parent. Although normally the parent's
	// layout is already set, in this case the parent is the same one passed
	// into createFormContent(...), but its layout was not already set.
	GridLayout grid = new GridLayout();
	grid.marginHeight = 0;
	grid.marginWidth = 0;
	parent.setLayout(grid);

	// Create a ToolBar.
	ToolBar toolBar = createToolBar(parent);

	// Create the plot content.
	plotComposite = null;
	try {
		plotComposite = getPlot().draw(parent);
	} catch (Exception e) {
		throwCriticalException("Error encountered while drawing plot.",
				"The selection could not be rendered by the selected "
						+ "visualization service. Please check the format "
						+ "of the file.",
				e);
	}

	// Layout the page
	toolBar.setLayoutData(
			new GridData(SWT.FILL | SWT.BEGINNING, SWT.FILL, true, false));
	plotComposite
			.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	parent.layout();

	return;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:46,代码来源:PlotEditor.java

示例15: createToolBarArea

import org.eclipse.swt.widgets.ToolBar; //导入方法依赖的package包/类
private void createToolBarArea(Composite editorBaseComposit)
 {
   //No need to remember toolbarAreaComposite: it is disposed with it's parent.
Composite toolbarAreaComposite = new Composite(editorBaseComposit, 0);
   GridLayout localGridLayout1 = new GridLayout(2, false);
   localGridLayout1.horizontalSpacing = 0;
   localGridLayout1.verticalSpacing = 0;
   localGridLayout1.marginHeight = 0;
   localGridLayout1.marginWidth = 0;
   toolbarAreaComposite.setBackgroundMode(SWT.INHERIT_FORCE);
   
   toolbarAreaComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_NORMAL_SHADOW));
   //toolbarAreaComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_HIGHLIGHT_SHADOW));
   //toolbarAreaComposite.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WIDGET_DARK_SHADOW));
   toolbarAreaComposite.setLayout(localGridLayout1);
   toolbarAreaComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
   
   
   this.toolbarTitleLabel = new Label(toolbarAreaComposite,0);
   this.toolbarTitleLabel.setText(createToolbarLabel());
   toolbarTitleLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));
   
   //No need to remember toolbar: it is disposed with it's parent.
   ToolBar toolBar = new ToolBar(toolbarAreaComposite, SWT.HORIZONTAL | SWT.FLAT | SWT.RIGHT | SWT.WRAP);
   toolBar.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false));
   toolBarManager = new ToolBarManager(toolBar);
   createToolBarActions(toolBarManager);
   toolbarAreaComposite.pack();
   this.toolBarManager.update(true);
   //setToolbarLabel(createToolbarLabel());
 }
 
开发者ID:scauwe,项目名称:IDM-Enh-Trace,代码行数:32,代码来源:AbstractTraceEditor.java


注:本文中的org.eclipse.swt.widgets.ToolBar.setLayoutData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。