本文整理汇总了Java中org.springframework.richclient.application.PageComponent类的典型用法代码示例。如果您正苦于以下问题:Java PageComponent类的具体用法?Java PageComponent怎么用?Java PageComponent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PageComponent类属于org.springframework.richclient.application包,在下文中一共展示了PageComponent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: NewBagInPlaceFrame
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* NewBagInPlaceFrame.
*
* @param bagView BagView
* @param title String
*/
public NewBagInPlaceFrame(final BagView bagView, final String title) {
super(title);
final Application app = Application.instance();
final ApplicationPage page = app.getActiveWindow().getPage();
final PageComponent component = page.getActiveComponent();
if (component != null) {
this.bagView = ApplicationContextUtil.getBagView();
} else {
this.bagView = bagView;
}
if (bagView != null) {
bag = bagView.getBag();
getContentPane().removeAll();
createPanel = createComponents();
} else {
createPanel = new JPanel();
}
getContentPane().add(createPanel, BorderLayout.CENTER);
final Dimension preferredDimension = new Dimension(400, 230);
setPreferredSize(preferredDimension);
setLocation(200, 100);
pack();
}
示例2: NewBagFrame
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* NewBagFrame.
*
* @param bagView BagView
* @param title String
*/
public NewBagFrame(final BagView bagView, final String title) {
super(title);
final JPanel createPanel;
final Application app = Application.instance();
final ApplicationPage page = app.getActiveWindow().getPage();
final PageComponent component = page.getActiveComponent();
if (component != null) {
this.bagView = ApplicationContextUtil.getBagView();
} else {
this.bagView = bagView;
}
if (bagView != null) {
getContentPane().removeAll();
createPanel = createComponents();
} else {
createPanel = new JPanel();
}
getContentPane().add(createPanel, BorderLayout.CENTER);
setPreferredSize(new Dimension(400, 200));
setLocation(300, 200);
pack();
}
示例3: setActiveComponent
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* Activates the given <code>PageComponent</code>. Does nothing if it is already the active one.
* <p>
* Does nothing if this <code>ApplicationPage</code> doesn't contain the given <code>PageComponent</code>.
*
* @param pageComponent
* the <code>PageComponent</code>
*/
public void setActiveComponent(PageComponent pageComponent) {
if (!pageComponents.contains(pageComponent)) {
return;
}
// if pageComponent is already active, don't do anything
if (this.activeComponent == pageComponent || settingActiveComponent) {
return;
}
settingActiveComponent = true;
try {
if (this.activeComponent != null) {
fireFocusLost(this.activeComponent);
}
giveFocusTo(pageComponent);
this.activeComponent = pageComponent;
fireFocusGained(this.activeComponent);
} finally {
// If this is not done in a finally, any exception thrown in fireFocusGained
// will prevent the user from leaving the screen
settingActiveComponent = false;
}
}
示例4: 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;
}
示例5: giveFocusTo
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
protected boolean giveFocusTo( final PageComponent pageComponent ) {
if( creatingDockable ) {
return false;
}
View view = getFlexView( pageComponent.getId() );
view.setActive( true );
// HACK: otherwise the first dockable that was active will still be active
for( Iterator iter = DockingManager.getDockableIds().iterator(); iter.hasNext(); ) {
String id = (String) iter.next();
if( !id.equals( pageComponent.getId() ) ) {
getFlexView( id ).setActive( false );
}
}
return true;
}
示例6: selectionChanged
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
public void selectionChanged(DockableSelectionEvent e) {
Dockable dockable = e.getSelectedDockable();
if (dockable != null) {
PageComponent pc = getPageComponent(dockable);
if (pc != null)
setActiveComponent(pc);
}
}
示例7: doRemovePageComponent
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* Only one pageComponent is shown at a time, so if it's the active one,
* remove all components from this page.
*/
protected void doRemovePageComponent( PageComponent pageComponent ) {
if (pageComponent == getActiveComponent())
{
this.control.removeAll();
this.control.validate();
this.control.repaint();
}
}
示例8: updatePageComponentProperties
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
protected void updatePageComponentProperties(PageComponent pageComponent) {
Dockable dockable = getDockable(pageComponent);
DockKey dockKey = dockable.getDockKey();
if (pageComponent.getIcon() != null) {
dockKey.setIcon(pageComponent.getIcon());
}
dockKey.setName(pageComponent.getDisplayName());
dockKey.setTooltip(pageComponent.getCaption());
}
示例9: componentFocusGained
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
public void componentFocusGained(PageComponent component) {
super.componentFocusGained(component);
PageComponentContext context = component.getContext();
for (Iterator i = window.getSharedCommands(); i.hasNext();) {
TargetableActionCommand globalCommand = (TargetableActionCommand)i.next();
globalCommand.setCommandExecutor(context.getLocalCommandExecutor(globalCommand.getId()));
}
}
示例10: updatePageComponentProperties
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
protected void updatePageComponentProperties(PageComponent pageComponent) {
int index = indexOf(pageComponent);
tabbedPane.setIconAt(index, pageComponent.getIcon());
tabbedPane.setTitleAt(index, pageComponent.getDisplayName());
tabbedPane.setToolTipTextAt(index, pageComponent.getCaption());
}
示例11: doAddPageComponent
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
protected void doAddPageComponent(PageComponent pageComponent) {
try {
addingComponent = true;
tabbedPane.addTab(pageComponent.getDisplayName(), pageComponent.getIcon(), pageComponent.getContext()
.getPane().getPageComponent().getControl(), pageComponent.getCaption());
} finally {
addingComponent = false;
}
}
示例12: dispose
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* Overridden close method to avoid memory leaks by Mikael Valot
*/
public void dispose(){
Collection pageComponents = new ArrayList(pageComponentMap.values());
Iterator it = pageComponents.iterator();
while(it.hasNext()){
PageComponent pageComponent = (PageComponent)it.next();
remove(pageComponent);
}
contentPane.dispose();
contentPane = null;
super.dispose();
}
示例13: resolveDockable
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
public Dockable resolveDockable(String keyName) {
ViewDescriptor descriptor = getViewDescriptor(keyName);
if (descriptor == null)
return null;
PageComponent pageComponent = createPageComponent(descriptor);
resolving = true;
addPageComponent(pageComponent);
resolving = false;
Dockable dockable = createDockable(descriptor, pageComponent);
return dockable;
}
示例14: findPageComponent
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
protected PageComponent findPageComponent(final String viewDescriptorId) {
for (PageComponent component : pageComponents) {
if (component.getId().equals(viewDescriptorId)) {
return component;
}
}
return null;
}
示例15: addPageComponent
import org.springframework.richclient.application.PageComponent; //导入依赖的package包/类
/**
* Adds the pageComponent to the components list while registering listeners and firing appropriate events. (not yet
* setting the component as the active one)
*
* @param pageComponent
* the pageComponent to add.
*/
protected void addPageComponent(PageComponent pageComponent) {
pageComponents.add(pageComponent);
doAddPageComponent(pageComponent);
pageComponent.addPropertyChangeListener(pageComponentUpdater);
fireOpened(pageComponent);
}