本文整理汇总了Java中org.springframework.richclient.application.PageComponent.getId方法的典型用法代码示例。如果您正苦于以下问题:Java PageComponent.getId方法的具体用法?Java PageComponent.getId怎么用?Java PageComponent.getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.richclient.application.PageComponent
的用法示例。
在下文中一共展示了PageComponent.getId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createView
import org.springframework.richclient.application.PageComponent; //导入方法依赖的package包/类
protected View createView( final PageComponent component ) {
View view = new View( component.getId() );
view.setTitle( component.getDisplayName() );
view.setTabText( component.getDisplayName() );
view.setTabIcon( component.getIcon() );
view.setIcon( component.getIcon() );
view.setContentPane( component.getControl() );
view.getViewProperties().addPropertyChangeListener( activeHandler );
configureView( component, view, getViewDescriptor( component.getId() ) );
dockables.put( component.getId(), view );
return view;
}
示例2: addDocumentComponent
import org.springframework.richclient.application.PageComponent; //导入方法依赖的package包/类
/**
* Adds a document to the editor workspace. The behaviour when an
* editor is already open, with editor identity defined by id property,
* is determined by the closeAndReopenEditor property. If this property
* is true, the default, the editor is closed and reopened. If false, the
* existing editor becomes the active one.
*
* @param pageComponent The page component to be added as a document
* @param activateAfterOpen specifies if the component should be activated after opening
*/
public void addDocumentComponent(final PageComponent pageComponent, boolean activateAfterOpen){
String id = pageComponent.getId();
if(!closeAndReopenEditor && contentPane.getDocument(id) != null){
contentPane.setActiveDocument(id);
}
else{
if(contentPane.getDocument(id) != null){
contentPane.closeDocument(id);
}
DocumentComponent document = constructDocumentComponent(pageComponent);
DocumentComponentListener lifecycleListener = constructLifecycleListener(pageComponent);
document.addDocumentComponentListener(lifecycleListener);
if(contentPane.getDocument(id) == null){
contentPane.openDocument(document);
}
if(activateAfterOpen){
contentPane.setActiveDocument(id);
}
registerDropTargetListeners(pageComponent.getControl());
// This listener ensures that the focus is transfered to the workspace
// itself if the number of documents becomes zero.
document.addDocumentComponentListener(new DocumentComponentAdapter(){
public void documentComponentClosed(DocumentComponentEvent event) {
int count = contentPane.getDocumentCount();
if(count == 0){
fireFocusGainedOnWorkspace();
}
}
});
pageComponentMap.put(id, pageComponent);
}
}
示例3: constructDocumentComponent
import org.springframework.richclient.application.PageComponent; //导入方法依赖的package包/类
private DocumentComponent constructDocumentComponent(final PageComponent pageComponent) {
String id = pageComponent.getId();
String title = pageComponent.getDisplayName();
Icon icon = pageComponent.getIcon();
DocumentComponent document = new DocumentComponent(
pageComponent.getContext().getPane().getControl(),
id, title, icon);
document.setTooltip(pageComponent.getDescription());
return document;
}