问题描述
如何在透视中配置静态视图宽度?
how can be configured static width of view in perspective?
我希望左侧 TreeViewer 具有静态宽度和第二个视图 (ViewPart) 想要水平扩展.我有这个,女巫使用的比率,我不想要:
I'd like have on left side TreeViewer with static width and second view (ViewPart) want to expand horizontaly. I have this, witch used ratio, that i don't want:
public class PerspectivaEkomaj implements IPerspectiveFactory {
@Override
public void createInitialLayout( IPageLayout layout ) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible( false );
layout.addView( EkomajTreeView.RCP_ID, IPageLayout.LEFT, 0.25f, editorArea );
layout.getViewLayout( EkomajTreeView.RCP_ID ).setCloseable( false );
layout.addStandaloneView( MajetekView.RCP_ID, false, IPageLayout.TOP, 0.75f, editorArea );
layout.addStandaloneViewPlaceholder( MajetekDMView.RCP_ID, IPageLayout.TOP, 0.75f, editorArea, false );
...
请让我知道是否存在一些允许它的解决方法或类似的类(与 SWT 兼容).
Pls let me know if exist some work around or similar class (compatible with SWT) that allow it.
推荐答案
如果您想控制特定工作台部件(视图或编辑器)的大小,请查看 org.eclipse.ui.ISizeProvider
界面.如果工作台部件可以适应 ISizeProvider
,那么这将用于计算结果大小.请参阅 org.eclipse.ui.internal.WorkbenchPartReference.computePreferredSize(...)
以获取相关的适配器代码...
If you want to control the size of a specific workbench part (view or editor), have a look at the org.eclipse.ui.ISizeProvider
interface. If a workbench part can be adapted to ISizeProvider
, then this is used to calculate the resulting size. See org.eclipse.ui.internal.WorkbenchPartReference.computePreferredSize(...)
for the relevant adapter code...
这篇关于如何设置静态宽度以在 SWT 中查看的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!