本文整理汇总了Java中org.eclipse.swt.custom.ScrolledComposite.addControlListener方法的典型用法代码示例。如果您正苦于以下问题:Java ScrolledComposite.addControlListener方法的具体用法?Java ScrolledComposite.addControlListener怎么用?Java ScrolledComposite.addControlListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swt.custom.ScrolledComposite
的用法示例。
在下文中一共展示了ScrolledComposite.addControlListener方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createPartControl
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
scrollComp = new ScrolledComposite(parent, SWT.V_SCROLL);
scrollComp.setLayoutData(new GridData(GridData.FILL_BOTH));
scrollComp.setLayout(new GridLayout(1,false));
scrollComp.setExpandVertical(true);
scrollComp.setExpandHorizontal(true);
scrollComp.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
refreshScrolledHeight();
}
});
mainContainer = new Composite(scrollComp, SWT.BORDER);
mainContainer.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
scrollComp.setContent(mainContainer);
mainContainer.setLayout(new ButtonFillLayout());
IWorkbenchPart editor = getContributingPart();
if (editor instanceof CachedSelectionProvider){
CachedSelectionProvider cachedSelEditor = (CachedSelectionProvider)editor;
cachedSelEditor.getSelectionCache().addSelectionChangeListener(selectionListener);
}
}
示例2: createUI
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private void createUI(final Composite parent) {
_tk = new FormToolkit(parent.getDisplay());
_scrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
{
_scrolledContent = _tk.createComposite(_scrolledContainer);
GridDataFactory.fillDefaults().applyTo(_scrolledContent);
GridLayoutFactory.swtDefaults().numColumns(1).applyTo(_scrolledContent);
{
createUI_10_StatisticsContainer(_scrolledContent);
}
// setup scrolled container
_scrolledContainer.setExpandVertical(true);
_scrolledContainer.setExpandHorizontal(true);
_scrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
onResizeScrolledContainer(_scrolledContent);
}
});
_scrolledContainer.setContent(_scrolledContent);
}
}
示例3: createUI_52_VertexScrolledContainer
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createUI_52_VertexScrolledContainer(final Composite parent) {
// scrolled container
_vertexScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_vertexScrolledContainer);
_vertexScrolledContainer.setExpandVertical(true);
_vertexScrolledContainer.setExpandHorizontal(true);
// vertex container
final Composite vertexContainer = new Composite(_vertexScrolledContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(vertexContainer);
GridLayoutFactory.fillDefaults()//
.numColumns(6)
.applyTo(vertexContainer);
// vertexContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_GRAY));
_vertexScrolledContainer.setContent(vertexContainer);
_vertexScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
_vertexScrolledContainer.setMinSize(vertexContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
return vertexContainer;
}
示例4: createUI_568_IL_SpeedTourType_ScrolledContainer
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createUI_568_IL_SpeedTourType_ScrolledContainer(final Composite parent) {
// scrolled container
_speedTourType_ScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_speedTourType_ScrolledContainer);
_speedTourType_ScrolledContainer.setExpandVertical(true);
_speedTourType_ScrolledContainer.setExpandHorizontal(true);
// container
final Composite speedTTContainer = new Composite(_speedTourType_ScrolledContainer, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(speedTTContainer);
GridLayoutFactory
.fillDefaults()//
.numColumns(5)
.applyTo(speedTTContainer);
_speedTourType_ScrolledContainer.setContent(speedTTContainer);
_speedTourType_ScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
_speedTourType_ScrolledContainer.setMinSize(speedTTContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
return speedTTContainer;
}
示例5: createUI_72_VertexScrolledContainer
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createUI_72_VertexScrolledContainer(final Composite parent) {
// scrolled container
_vertexScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
GridDataFactory.fillDefaults().grab(false, true).applyTo(_vertexScrolledContainer);
_vertexScrolledContainer.setExpandVertical(true);
_vertexScrolledContainer.setExpandHorizontal(true);
// vertex container
final Composite vertexContainer = new Composite(_vertexScrolledContainer, SWT.NONE);
GridLayoutFactory.fillDefaults().numColumns(3).applyTo(vertexContainer);
_vertexScrolledContainer.setContent(vertexContainer);
_vertexScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
_vertexScrolledContainer.setMinSize(vertexContainer.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
return vertexContainer;
}
示例6: createRelationTabItem
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private void createRelationTabItem(CTabFolder folder) {
CTabItem tbtmMain = new CTabItem(folder, SWT.NONE);
tbtmMain.setText("Relations");
tbtmMain.setData("relation", "relation");
final ScrolledComposite scrollComposite = new ScrolledComposite(folder,
SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
final Composite relationsComp = new Composite(scrollComposite, SWT.NONE);
tbtmMain.setControl(scrollComposite);
scrollComposite.setContent(relationsComp);
scrollComposite.setExpandVertical(true);
scrollComposite.setExpandHorizontal(true);
scrollComposite.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
Rectangle r = scrollComposite.getClientArea();
scrollComposite.setMinSize(relationsComp.computeSize(r.width,
SWT.DEFAULT));
}
});
relationsComp.setLayout(new GridLayout(
BTSUIConstants.PASSPORT_COLUMN_NUMBER, true));
((GridLayout) relationsComp.getLayout()).marginWidth = 0;
((GridLayout) relationsComp.getLayout()).marginHeight = 0;
}
示例7: createIdentifiersTabItem
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private void createIdentifiersTabItem(CTabFolder folder) {
CTabItem tbtmMain = new CTabItem(folder, SWT.NONE);
tbtmMain.setText("IDs");
tbtmMain.setToolTipText("External Identifiers");
tbtmMain.setData("id", "id");
final ScrolledComposite scrollComposite = new ScrolledComposite(folder,
SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
final Composite idsComp = new Composite(scrollComposite, SWT.NONE);
tbtmMain.setControl(scrollComposite);
scrollComposite.setContent(idsComp);
scrollComposite.setExpandVertical(true);
scrollComposite.setExpandHorizontal(true);
scrollComposite.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent e) {
Rectangle r = scrollComposite.getClientArea();
scrollComposite.setMinSize(idsComp.computeSize(r.width,
SWT.DEFAULT));
}
});
idsComp.setLayout(new GridLayout(
BTSUIConstants.PASSPORT_COLUMN_NUMBER, true));
((GridLayout) idsComp.getLayout()).marginWidth = 0;
((GridLayout) idsComp.getLayout()).marginHeight = 0;
}
示例8: createUI
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private void createUI(final Composite parent) {
final ScrolledComposite scrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
scrolledContainer.setExpandVertical(true);
scrolledContainer.setExpandHorizontal(true);
final Composite container = new Composite(scrolledContainer, SWT.NONE);
GridLayoutFactory.fillDefaults()//
// .spacing(0, 0)
.applyTo(container);
// container.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_RED));
{
createUI10ChartType(container);
}
/*
* setup scrolled container
*/
scrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
scrolledContainer.setMinSize(container.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
scrolledContainer.setContent(container);
}
示例9: createUITab_30_Info
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Composite createUITab_30_Info(final Composite parent) {
/*
* scrolled container
*/
_tab4Container = new ScrolledComposite(parent, SWT.V_SCROLL | SWT.H_SCROLL);
_tab4Container.setExpandVertical(true);
_tab4Container.setExpandHorizontal(true);
_tab4Container.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
onResizeTabInfo();
}
});
{
_infoContainer = new Composite(_tab4Container, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_infoContainer);
_tk.adapt(_infoContainer);
GridLayoutFactory.swtDefaults().applyTo(_infoContainer);
}
// set content for scrolled composite
_tab4Container.setContent(_infoContainer);
createUISection_300_Info(_infoContainer);
return _tab4Container;
}
示例10: createUI_10_Smoothing
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private Control createUI_10_Smoothing(final Composite parent) {
_tk = new FormToolkit(parent.getDisplay());
_smoothingUI = new SmoothingUI();
_smoothingScrolledContainer = new ScrolledComposite(parent, SWT.V_SCROLL);
GridDataFactory.fillDefaults().grab(true, true).applyTo(_smoothingScrolledContainer);
{
_smoothingScrolledContent = _tk.createComposite(_smoothingScrolledContainer);
GridDataFactory
.fillDefaults()//
.grab(true, true)
.hint(DEFAULT_DESCRIPTION_WIDTH, SWT.DEFAULT)
.applyTo(_smoothingScrolledContent);
GridLayoutFactory
.swtDefaults() //
.extendedMargins(5, 5, 10, 5)
.numColumns(1)
.applyTo(_smoothingScrolledContent);
// _smoothingScrolledContent.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_MAGENTA));
{
_smoothingUI.createUI(_smoothingScrolledContent, true, true);
}
// setup scrolled container
_smoothingScrolledContainer.setExpandVertical(true);
_smoothingScrolledContainer.setExpandHorizontal(true);
_smoothingScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
_smoothingScrolledContainer.setMinSize(//
_smoothingScrolledContent.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
});
_smoothingScrolledContainer.setContent(_smoothingScrolledContent);
}
return _smoothingScrolledContainer;
}
示例11: createUI_70_HrZone
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
private void createUI_70_HrZone(final Composite parent) {
final Composite hrZoneContainer = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults()//
.grab(true, true)
.applyTo(hrZoneContainer);
GridLayoutFactory.fillDefaults().numColumns(1).applyTo(hrZoneContainer);
// hrZoneContainer.setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_BLUE));
{
/*
* container for hr zone fields
*/
// scrolled container
_hrZoneScrolledContainer = new ScrolledComposite(hrZoneContainer, //
SWT.V_SCROLL //
| SWT.H_SCROLL
// | SWT.BORDER
);
GridDataFactory.fillDefaults()//
.grab(true, true)
.hint(SWT.DEFAULT, convertHeightInCharsToPixels(10))
.applyTo(_hrZoneScrolledContainer);
// _hrZoneScrolledContainer.setAlwaysShowScrollBars(true);
_hrZoneScrolledContainer.setExpandVertical(true);
_hrZoneScrolledContainer.setExpandHorizontal(true);
_hrZoneScrolledContainer.addControlListener(new ControlAdapter() {
@Override
public void controlResized(final ControlEvent e) {
final Control content = _hrZoneScrolledContainer.getContent();
if (content != null) {
// _hrZoneScrolledContainer.setMinSize(content.computeSize(SWT.DEFAULT, SWT.DEFAULT));
}
}
});
}
}
示例12: createPartControl
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
@Override
public void createPartControl(Composite parent) {
partService = (IPartService) getSite().getService(IPartService.class);
watchDogViewListener = new WatchDogViewListener(this);
partService.addPartListener(watchDogViewListener);
this.parent = parent;
scrolledComposite = new ScrolledComposite(parent,
SWT.H_SCROLL | SWT.V_SCROLL);
scrolledComposite.setLayout(new FillLayout());
scrolledComposite.setExpandHorizontal(true);
scrolledComposite.setExpandVertical(true);
scrolledComposite.addControlListener(new ControlAdapter() {
public void controlResized(ControlEvent e) {
Rectangle r = scrolledComposite.getClientArea();
scrolledComposite.setMinSize(
oneColumn.computeSize(r.width, SWT.DEFAULT));
}
});
oneColumn = UIUtils.createGridedComposite(scrolledComposite, 1);
scrolledComposite.setContent(oneColumn);
if (!WatchDogGlobals.isActive) {
createInactiveViewContent();
} else {
calculateTimes();
latestDebugIntervals = intervalStatistics
.getLatestDebugIntervals(NUMBER_OF_INTERVALS_TO_SHOW);
if (selectedDebugIntervalShouldBeReset()) {
selectedDebugInterval = !latestDebugIntervals.isEmpty()
? latestDebugIntervals.get(0) : null;
}
createActiveView();
}
// Always create refresh link, even when statistics are not shown
createRefreshLink();
}
示例13: createPageControl
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
public Control createPageControl( Composite parent )
{
sComposite = new ScrolledComposite( parent, SWT.H_SCROLL
| SWT.V_SCROLL );
sComposite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
sComposite.setExpandHorizontal( true );
sComposite.setExpandVertical( true );
sComposite.addControlListener( new ControlAdapter( ) {
public void controlResized( ControlEvent e )
{
computeSize( );
}
} );
composite = new Composite( sComposite, SWT.NONE );
GridLayout layout = new GridLayout( );
layout.marginWidth = 0;
layout.marginHeight = 0;
composite.setLayout( layout );
if ( getPageDescription( ) != null )
{
pageDescription = new Label( composite, SWT.NONE );
pageDescription.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
pageDescription.setText( getPageDescription( ) );
pageDescription.setToolTipText( getPageDescription( ) );
}
GridData data = new GridData( GridData.FILL_BOTH );
Control control = createContents( composite );
control.setLayoutData( data );
sComposite.setContent( composite );
return sComposite;
}
示例14: buildUI
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
public void buildUI( Composite parent )
{
container = new ScrolledComposite( parent, SWT.V_SCROLL | SWT.H_SCROLL );
container.setLayoutData( new GridData( GridData.FILL_BOTH ) );
( (ScrolledComposite) container ).setExpandHorizontal( true );
( (ScrolledComposite) container ).setExpandVertical( true );
container.addControlListener( new ControlAdapter( ) {
public void controlResized( ControlEvent e )
{
computeSize( );
}
} );
composite = new Composite( container, SWT.NONE );
composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
if ( sections == null )
sections = new SortMap( );
composite.setLayout( WidgetUtil.createGridLayout( 1 ) );
previewSection = new PreviewSection( provider.getDisplayName( ),
composite,
true,
isTabbed );
previewSection.setPreview( preview );
previewSection.setProvider( provider );
previewSection.setHeight( 160 );
previewSection.setFillPreview( true );
addSection( PageSectionId.PREVIEW_PREVIEW, previewSection );
createSections( );
layoutSections( );
( (ScrolledComposite) container ).setContent( composite );
}
示例15: createMainWindowComposite
import org.eclipse.swt.custom.ScrolledComposite; //导入方法依赖的package包/类
public Composite createMainWindowComposite(Composite parent) {
removeImage = CloudFoundryImages.REMOVE.createImage();
group = new Group(parent, SWT.SHADOW_IN);
group.setText(Messages.CloudFoundryServiceWizardPageRightPanel_SERVICES_TO_CREATE);
group.setLayout(new FillLayout());
group.addDisposeListener(new DisposeListener() {
@Override
public void widgetDisposed(DisposeEvent e) {
if (boldFont != null && !boldFont.isDisposed()) {
boldFont.dispose();
}
if (removeImage != null && !removeImage.isDisposed()) {
removeImage.dispose();
}
}
});
scrollComp = new ScrolledComposite(group, SWT.V_SCROLL);
scrollComp.setAlwaysShowScrollBars(false);
layoutList = createLayoutList(scrollComp);
scrollComp.setContent(layoutList);
scrollComp.addControlListener(new ControlAdapter() {
@Override
public void controlResized(ControlEvent event) {
Control c = scrollComp.getContent();
if (c == null) {
return;
}
Rectangle r = scrollComp.getClientArea();
r.height = c.computeSize(r.width, SWT.DEFAULT).y;
c.setBounds(r);
}
});
return group;
}