當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。