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


Java ScrolledComposite类代码示例

本文整理汇总了Java中org.eclipse.swt.custom.ScrolledComposite的典型用法代码示例。如果您正苦于以下问题:Java ScrolledComposite类的具体用法?Java ScrolledComposite怎么用?Java ScrolledComposite使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: createFeatureListTab

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void createFeatureListTab(TabFolder tabFolder, ActiveTab type) {
	TabItem tabItem = new TabItem(tabFolder, SWT.NULL);
	if (type == ActiveTab.ALL_FEATURES) {
		tabItem.setText(ALL_FEATURES_TAB_TITLE);
	} else {
		tabItem.setText(UPDATES_TAB_TITLE);
	}
	ScrolledComposite scroll = new ScrolledComposite(tabFolder, SWT.V_SCROLL | SWT.H_SCROLL);
	scroll.setLayout(new GridLayout());
	scroll.setLayoutData(new GridData());

	Group group = new Group(scroll, SWT.NONE);
	group.setLayout(new GridLayout());
	group.setLayoutData(new GridData());
	listFeatures(group, type);
	scroll.setContent(group);
	scroll.setExpandHorizontal(true);
	scroll.setExpandVertical(true);
	scroll.setMinSize(group.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	tabItem.setControl(scroll);
}
 
开发者ID:wso2,项目名称:developer-studio,代码行数:22,代码来源:UpdaterDialog.java

示例2: DiskInfoTab

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
/**
 * Create the DISK INFO tab.
 */
public DiskInfoTab(CTabFolder tabFolder, FormattedDisk[] disks) {
	this.formattedDisks = disks;
	
	CTabItem ctabitem = new CTabItem(tabFolder, SWT.NULL);
	ctabitem.setText(textBundle.get("DiskInfoTab.Title")); //$NON-NLS-1$
	
	tabFolder.addSelectionListener(new SelectionAdapter() {
		public void widgetSelected(SelectionEvent event) {
			getInfoTable().removeAll();
			buildDiskInfoTable(getFormattedDisk(0));	// FIXME!
		}
	});
	
	ScrolledComposite scrolledComposite = new ScrolledComposite(
		tabFolder, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL);
	scrolledComposite.setExpandHorizontal(true);
	scrolledComposite.setExpandVertical(true);
	ctabitem.setControl(scrolledComposite);
	
	composite = new Composite(scrolledComposite, SWT.NONE);
	createDiskInfoTable();
	if (disks.length > 1) {
		RowLayout layout = new RowLayout(SWT.VERTICAL);
		layout.wrap = false;
		composite.setLayout(layout);
		for (int i=0; i<disks.length; i++) {
			Label label = new Label(composite, SWT.NULL);
			label.setText(disks[i].getDiskName());
			buildDiskInfoTable(disks[i]);
		}
	} else {
		composite.setLayout(new FillLayout());
		buildDiskInfoTable(disks[0]);
	}
	composite.pack();
	scrolledComposite.setContent(composite);
	scrolledComposite.setMinSize(
		composite.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:43,代码来源:DiskInfoTab.java

示例3: setupPagingInformation

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
/**
 * Setup some sensible paging information.
 */
public static void setupPagingInformation(ScrolledComposite composite) {
	GC gc = new GC(composite);
	FontMetrics fontMetrics = gc.getFontMetrics();
	gc.dispose();
	int fontHeight = fontMetrics.getHeight();
	int fontWidth = fontMetrics.getAverageCharWidth();
	Rectangle clientArea = composite.getClientArea();
	int lines = clientArea.height / fontHeight;
	int pageHeight = lines * fontHeight;
	int pageWidth = clientArea.width - fontWidth; 
	composite.getVerticalBar().setIncrement(fontHeight);
	composite.getVerticalBar().setPageIncrement(pageHeight);
	composite.getHorizontalBar().setIncrement(fontWidth);
	composite.getHorizontalBar().setPageIncrement(pageWidth);
}
 
开发者ID:AppleCommander,项目名称:AppleCommander,代码行数:19,代码来源:SwtUtil.java

示例4: attachMouseScrollButtonListener

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void attachMouseScrollButtonListener(final ScrolledComposite scrolledComposite){
	scrolledComposite.addListener(SWT.MouseWheel, new Listener() {
		@Override
		public void handleEvent(Event event) {
			int wheelCount = event.count;
			wheelCount = (int) Math.ceil(wheelCount / 3.0f);
			while (wheelCount < 0) {
				scrolledComposite.getVerticalBar().setIncrement(4);
				wheelCount++;
			}

			while (wheelCount > 0) {
				scrolledComposite.getVerticalBar().setIncrement(-4);
				wheelCount--;
			}
		}
	});
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:19,代码来源:PropertyDialogBuilder.java

示例5: filterTree

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
protected void filterTree(TreeItem[] items, String text,
		ArrayList<TreeItem> foundItems) {
	text = text.toLowerCase();
	for (int i = 0; i < items.length; i++) {
		ensureSectionBuilt(items[i], false);
		ScrolledComposite composite = (ScrolledComposite) items[i].getData("Panel");

		if (text.length() > 0
				&& (items[i].getText().toLowerCase().contains(text) || compositeHasText(
						composite, text))) {
			foundItems.add(items[i]);

			ensureExpandedTo(items[i]);
			items[i].setFont(filterFoundFont);
		} else {
			items[i].setFont(null);
		}
		filterTree(items[i].getItems(), text, foundItems);
	}
}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:21,代码来源:ConfigView.java

示例6: setViewRequiresOneDownload

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
public static void setViewRequiresOneDownload(Composite genComposite) {
	if (genComposite == null || genComposite.isDisposed()) {
		return;
	}
	Utils.disposeComposite(genComposite, false);

	Label lab = new Label(genComposite, SWT.NULL);
	GridData gridData = new GridData(SWT.CENTER, SWT.CENTER, true, true);
	gridData.verticalIndent = 10;
	lab.setLayoutData(gridData);
	Messages.setLanguageText(lab, "view.one.download.only");

	genComposite.layout(true);

	Composite parent = genComposite.getParent();
	if (parent instanceof ScrolledComposite) {
		ScrolledComposite scrolled_comp = (ScrolledComposite) parent;

		Rectangle r = scrolled_comp.getClientArea();
		scrolled_comp.setMinSize(genComposite.computeSize(r.width, SWT.DEFAULT ));
	}

}
 
开发者ID:BiglySoftware,项目名称:BiglyBT,代码行数:24,代码来源:ViewUtils.java

示例7: NotesCheckinControl

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
protected NotesCheckinControl(final Composite parent, final int style, final CheckinControlOptions options) {
    super(parent, style, Messages.getString("NotesCheckinControl.Title"), CheckinSubControlType.CHECKIN_NOTES); //$NON-NLS-1$

    this.options = options;

    final FillLayout layout = new FillLayout();
    layout.marginHeight = 0;
    layout.marginWidth = 0;
    setLayout(layout);

    final int rootStyle = options.isForDialog() ? SWT.BORDER : SWT.NONE;
    rootComposite = new ScrolledComposite(this, SWT.V_SCROLL | rootStyle);
    rootComposite.setLayout(new FillLayout());
    rootComposite.setExpandHorizontal(true);
    rootComposite.setExpandVertical(true);

    addDisposeListener(new DisposeListener() {
        @Override
        public void widgetDisposed(final DisposeEvent e) {
            if (pendingCheckin != null) {
                pendingCheckin.getPendingChanges().removeAffectedTeamProjectsChangedListener(teamProjectsListener);
            }
        }
    });
}
 
开发者ID:Microsoft,项目名称:team-explorer-everywhere,代码行数:26,代码来源:NotesCheckinControl.java

示例8: getLayoutChangedHandler

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private Runnable getLayoutChangedHandler() {
  return new Runnable() {

    @Override
    public void run() {
      // resize the page to work around https://bugs.eclipse.org/bugs/show_bug.cgi?id=265237
      Composite parent = getActivePanel().getParent();
      while (parent != null) {
        if (parent instanceof ScrolledComposite) {
          ScrolledComposite scrolledComposite = (ScrolledComposite) parent;
          scrolledComposite.setMinSize(getActivePanel().getParent().computeSize(SWT.DEFAULT, SWT.DEFAULT));
          getActivePanel().layout();
          return;
        }
        parent = parent.getParent();
      }
    }
  };
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:20,代码来源:DeployPropertyPage.java

示例9: FXCanvasScrollApp

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
protected FXCanvasScrollApp() {
    shell = new Shell();
    shell.setText(this.getClass().getSimpleName());
    shell.setLayout(new FillLayout());

    ScrolledComposite scrollPane = new ScrolledComposite(shell, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
    FXCanvas fxCanvas = new FXCanvas(scrollPane, SWT.BORDER);
    fxCanvas.setScene(createScene(SCROLL_CONTAINER_ID));
    scrollPane.setContent(fxCanvas);
    scrollPane.setExpandHorizontal(true);
    scrollPane.setExpandVertical(true);
    fxCanvas.pack();
    scrollPane.setMinSize(fxCanvas.getSize());

    shell.pack();
    Monitor monitor = shell.getMonitor();
    Rectangle monitorRect = monitor.getClientArea();
    Rectangle shellRect = shell.getBounds();
    shellRect.x = Math.max(0, (monitorRect.width - shellRect.width) / 2);
    shellRect.y = Math.max(0, (monitorRect.height - shellRect.height) / 2);
    shell.setBounds(shellRect);
    shell.open();
}
 
开发者ID:teamfx,项目名称:openjfx-8u-dev-tests,代码行数:24,代码来源:FXCanvasScrollApp.java

示例10: handleRemoveButtonClick

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void handleRemoveButtonClick(SelectionEvent event) {
	Button btnThis = (Button) event.getSource();
	Composite parent = btnThis.getParent();
	Control[] children = parent.getChildren();
	if (children != null) {
		for (int i = 0; i < children.length; i++) {
			if (children[i].equals(btnThis) && i - 1 > 0) {
				Group group = (Group) children[i - 1];
				Control[] childrenOfGroup = group.getChildren();
				Label number = (Label) childrenOfGroup[0];
				Integer intNumber = Integer.parseInt(number.getText());
				nodeMap.remove(intNumber);
				children[i - 1].dispose();
				children[i].dispose();
				redraw();
				break;
			}
		}
	}

	innerContainer.setSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
	((ScrolledComposite) cmpMain).setMinSize(innerContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));

	updatePageCompleteStatus();
}
 
开发者ID:Pardus-LiderAhenk,项目名称:lider-ahenk-installer,代码行数:26,代码来源:LiderClusterConfPage.java

示例11: setSize

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void setSize(Composite composite) {
	if (composite != null) {
		// Note: The font is set here in anticipation that the class
		// inheriting
		// this base class may add widgets to the dialog. setSize
		// is assumed to be called just before we go live.
		applyDialogFont(composite);
		Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		composite.setSize(minSize);
		// set scrollbar composite's min size so page is expandable but
		// has scrollbars when needed
		if (composite.getParent() instanceof ScrolledComposite) {
			ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
			sc1.setMinSize(minSize);
			sc1.setExpandHorizontal(true);
			sc1.setExpandVertical(true);
		}
	}
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:20,代码来源:AngularGlobalPreferencesPage.java

示例12: setSize

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void setSize(Composite composite) {
	if (composite != null) {
		// Note: The font is set here in anticipation that the class inheriting
		//       this base class may add widgets to the dialog.   setSize
		//       is assumed to be called just before we go live.
		applyDialogFont(composite);
		Point minSize = composite.computeSize(SWT.DEFAULT, SWT.DEFAULT);
		composite.setSize(minSize);
		// set scrollbar composite's min size so page is expandable but
		// has scrollbars when needed
		if (composite.getParent() instanceof ScrolledComposite) {
			ScrolledComposite sc1 = (ScrolledComposite) composite.getParent();
			sc1.setMinSize(minSize);
			sc1.setExpandHorizontal(true);
			sc1.setExpandVertical(true);
		}
	}
}
 
开发者ID:angelozerr,项目名称:angular-eclipse,代码行数:19,代码来源:HTMLAngularGlobalPreferencesPage.java

示例13: LayoutGeneral

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
/**
 * Creates the Complete General Tab
 * @param parent The Parent Folder
 * @param meta The Meta Include for this Project
 * @param props The PropsUI from the Kettle Project
 * @param fieldNames The FieldNames from the Previous Step
 */
public LayoutGeneral(final CTabFolder parent, ARXPluginMeta meta, final PropsUI props, String[] fieldNames) {
	this.meta = meta;
	this.props = props;
	this.fieldNames = fieldNames;
	composites = new LayoutCompositeInterface[2];

	CTabItem tabGeneral = new CTabItem(parent, SWT.NONE);
	tabGeneral.setText(Resources.getMessage("General.2"));
	ScrolledComposite scroller = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
	this.build(scroller);
	tabGeneral.setControl(scroller);
	{

	}
}
 
开发者ID:WiednerF,项目名称:ARXPlugin,代码行数:23,代码来源:LayoutGeneral.java

示例14: reattachWidget

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
private void reattachWidget(Position pos) {
	SashForm sf = positionSashFormMap.get(pos);
	ScrolledComposite w = widgets.get(pos);
	if (w.getParent() == sf) // already attached to SashForm -> do nothing!
		return;
	
	w.setParent(sf); // set parent to SashForm again
	
	// move to left or right side of SashForm depending on flag in position:
	if (pos.isLeftSideOfSashForm)
		w.moveAbove(null);
	else
		w.moveBelow(null);
	
	sf.layout(true);
}
 
开发者ID:Transkribus,项目名称:TranskribusSwtGui,代码行数:17,代码来源:PortalWidget.java

示例15: createPartControl

import org.eclipse.swt.custom.ScrolledComposite; //导入依赖的package包/类
@Override
public void createPartControl(final Composite parent) {
	try {
		final Composite outer = toolkit.createComposite(parent, SWT.NONE);
		final GridLayout layout = new GridLayout(1, false);
		layout.marginHeight = layout.marginWidth = 0;
		outer.setLayout(layout);
		final GridData layoutData = new GridData(GridData.FILL_BOTH);
		outer.setLayoutData(layoutData);

		createValidationComposite(outer);

		final ScrolledComposite content = new ScrolledComposite(outer, SWT.H_SCROLL | SWT.V_SCROLL);
		content.setExpandHorizontal(true);
		content.setExpandVertical(true);
		content.setLayout(layout);
		content.setLayoutData(layoutData);
		final Composite children = initUi(content);
		content.setMinSize(children.computeSize(SWT.DEFAULT, SWT.DEFAULT));
		content.setContent(children);
		createBinding();
		additionalTasks();
	} catch (final ConnectException e) {
		handle(e);
	}
}
 
开发者ID:FI13,项目名称:afbb-bibo,代码行数:27,代码来源:AbstractView.java


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