本文整理汇总了Java中org.springframework.richclient.command.AbstractCommand类的典型用法代码示例。如果您正苦于以下问题:Java AbstractCommand类的具体用法?Java AbstractCommand怎么用?Java AbstractCommand使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
AbstractCommand类属于org.springframework.richclient.command包,在下文中一共展示了AbstractCommand类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createCommands
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
protected List<AbstractCommand> createCommands()
{
int i = isAddSupported() ? 1 : 0;
i = isRemoveSupported() ? i + 1 : i;
i = isShowDetailSupported() ? i + 1 : i;
i = isEditSupported() ? i + 1 : i;
this.commands = new ArrayList<AbstractCommand>(i);
if (isShowDetailSupported())
commands.add(getDetailCommand());
if (isAddSupported())
commands.add(getAddCommand());
if (isRemoveSupported())
commands.add(getRemoveCommand());
if (isEditSupported())
commands.add(getEditCommand());
return this.commands;
}
示例2: createAddCommand
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
@Override
protected AbstractCommand createAddCommand()
{
AbstractCommand addRow = new ActionCommand("addrow")
{
@Override
protected void doExecuteCommand()
{
add(viewControllerObject);
}
};
addRow.setSecurityControllerId(getAddCommandSecurityControllerId());
RcpSupport.configure(addRow);
return addRow;
}
示例3: createDetailCommand
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
@Override
protected AbstractCommand createDetailCommand()
{
AbstractCommand detail = new ActionCommand("detailrow")
{
@Override
protected void doExecuteCommand()
{
Object[] selection = table.getSelectedRows();
if (selection.length > 0)
showDetail(selection);
}
};
RcpSupport.configure(detail);
return detail;
}
示例4: createEditCommand
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
@Override
protected AbstractCommand createEditCommand()
{
ActionCommand editRow = new ActionCommand("editrow")
{
@Override
protected void doExecuteCommand()
{
edit(table.getSelectedRows());
}
};
editRow.setSecurityControllerId(getEditCommandSecurityControllerId());
RcpSupport.configure(editRow);
return editRow;
}
示例5: getCommandGroupMembers
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
protected Object[] getCommandGroupMembers() {
if (!wizard.needsPreviousAndNextButtons()) {
return super.getCommandGroupMembers();
}
nextCommand = new ActionCommand("nextCommand") {
public void doExecuteCommand() {
onNext();
}
};
backCommand = new ActionCommand("backCommand") {
public void doExecuteCommand() {
onBack();
}
};
backCommand.setEnabled(false);
return new AbstractCommand[] { backCommand, nextCommand, getFinishCommand(), getCancelCommand() };
}
示例6: getFaceDescriptor
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
public CommandFaceDescriptor getFaceDescriptor(AbstractCommand command, String faceDescriptorId) {
if (beanFactory == null) {
return null;
}
try {
return (CommandFaceDescriptor)beanFactory.getBean(command.getId() + "." + faceDescriptorId,
CommandFaceDescriptor.class);
}
catch (NoSuchBeanDefinitionException e) {
try {
return (CommandFaceDescriptor)beanFactory.getBean(faceDescriptorId, CommandFaceDescriptor.class);
}
catch (NoSuchBeanDefinitionException ex) {
return null;
}
}
}
示例7: configure
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
public void configure(AbstractButton button, AbstractCommand command, CommandFaceDescriptor faceDescriptor)
{
Assert.notNull(button, "The button to configure cannot be null.");
Assert.notNull(faceDescriptor, "The command face descriptor cannot be null.");
if (StringUtils.hasText(faceDescriptor.getDescription()))
button.setText(faceDescriptor.getDescription());
else
button.setText(faceDescriptor.getText());
button.setToolTipText(faceDescriptor.getCaption());
if (faceDescriptor.getLargeIcon() != null)
faceDescriptor.configureIconInfo(button, true);
else
faceDescriptor.configureIcon(button);
try
{
button.setUI((ButtonUI) Class.forName((String) UIManager.get("LinkButtonUI")).newInstance());
}
catch (Exception e)
{
}
}
示例8: configure
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
public AbstractCommand configure(AbstractCommand command, ApplicationObjectConfigurer configurer) {
command.setCommandServices(getCommandServices());
String objectName = command.getId();
if (command.isAnonymous()) {
objectName = ClassUtils.getShortNameAsProperty(command.getClass());
int lastDot = objectName.lastIndexOf('.');
if (lastDot != -1) {
objectName = StringUtils.uncapitalize(objectName.substring(lastDot + 1));
}
}
// Configure the command itself
configurer.configure( command, objectName );
// Configure the command face
if (logger.isDebugEnabled()) {
logger.debug("Configuring faces (aka visual appearance descriptors) for " + command);
}
CommandFaceDescriptor face = new CommandFaceDescriptor();
configurer.configure(face, objectName);
command.setFaceDescriptor(face);
return command;
}
示例9: configure
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
public void configure(AbstractButton button, AbstractCommand command, CommandFaceDescriptor faceDescriptor) {
super.configure(button, command, faceDescriptor);
if (textBelowIcon) {
button.setHorizontalTextPosition(JButton.CENTER);
button.setVerticalTextPosition(JButton.BOTTOM);
}
if (!showText) {
if (button.getIcon() != null) {
button.setText(null);
}
}
if (enableShadow && button.getIcon() != null && button.getRolloverIcon() == null) {
button.setRolloverEnabled(true);
button.setRolloverIcon(new ShadowedIcon(button.getIcon()));
}
button.setMargin(new Insets(2, 5, 2, 5));
}
示例10: createControl
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
protected JComponent createControl()
{
JComponent widgetComponent = getWidget().getComponent();
JPanel viewPanel = new JPanel(new BorderLayout());
viewPanel.add(widgetComponent, BorderLayout.CENTER);
Widget widget = getWidget();
List<? extends AbstractCommand> widgetCommands = widget.getCommands();
if (widgetCommands != null)
{
JComponent widgetButtonBar = CommandGroup.createCommandGroup(widgetCommands).createButtonBar(ColumnSpec.decode("fill:pref:nogrow"), RowSpec.decode("fill:default:nogrow"), null);
JPanel buttonPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
buttonPanel.add(widgetButtonBar);
buttonPanel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
viewPanel.add(buttonPanel, BorderLayout.SOUTH);
}
return viewPanel;
}
示例11: createTitledDialogContentPane
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
@Override
protected JComponent createTitledDialogContentPane() {
messageArea = new JTextArea();
messageArea.setEditable(false);
Reporter reporter = getReporter();
Assert.notNull(reporter);
reporter.setMessageArea(messageArea);
JPanel panel = new JPanel(new FormLayout(new ColumnSpec[] {
new ColumnSpec(ColumnSpec.FILL, Sizes.PREFERRED, FormSpec.DEFAULT_GROW),
FormFactory.UNRELATED_GAP_COLSPEC, new ColumnSpec(ColumnSpec.FILL, Sizes.DEFAULT, FormSpec.NO_GROW) },
new RowSpec[] { new RowSpec(RowSpec.FILL, Sizes.DEFAULT, FormSpec.DEFAULT_GROW), }));
CellConstraints cc = new CellConstraints();
panel.add(reporter.getControl(), cc.xy(1, 1));
AbstractCommand[] reporterCommands = reporter.getReporterCommands();
AbstractCommand[] commandStack = new AbstractCommand[reporterCommands.length + 1];
System.arraycopy(reporterCommands, 0, commandStack, 0, reporterCommands.length);
commandStack[reporterCommands.length] = getClearTextAreaCommand();
CommandGroup commandGroup = CommandGroup.createCommandGroup(commandStack);
panel.add(commandGroup.createButtonStack(), cc.xy(3, 1));
JScrollPane scrollPane = new JScrollPane(messageArea,
ScrollPaneConstants.VERTICAL_SCROLLBAR_ALWAYS, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, panel, scrollPane);
scrollPane.setPreferredSize(new Dimension(200, 100));
return splitPane;
}
开发者ID:danilovalente,项目名称:spring-richclient,代码行数:27,代码来源:AbstractReporterTitledApplicationDialog.java
示例12: configure
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void configure(final AbstractButton button, final AbstractCommand command,
final CommandFaceDescriptor faceDescriptor) {
super.configure(button, command, faceDescriptor);
faceDescriptor.configureIconInfo(button, this.getUseLargeIcons());
}
示例13: readOnlyChanged
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
/**
* Enable/disable the commands on readOnly change or valueModelChange
*/
@Override
protected void readOnlyChanged()
{
for (AbstractCommand abstractCommand : getCommands())
{
if (isShowDetailSupported() && abstractCommand == getDetailCommand())
(abstractCommand).setEnabled(isEnabled());
else
(abstractCommand).setEnabled(isEnabled() && !isReadOnly());
}
}
示例14: registerCommandFaceDescriptor
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
private void registerCommandFaceDescriptor(String faceId, AbstractCommand command)
{
CommandFaceDescriptor face = new CommandFaceDescriptor();
ApplicationObjectConfigurer configurer = (ApplicationObjectConfigurer)ApplicationServicesLocator.services().getService(ApplicationObjectConfigurer.class);
configurer.configure(face, faceId);
command.setFaceDescriptor(faceId, face);
}
示例15: createDetailFormDialog
import org.springframework.richclient.command.AbstractCommand; //导入依赖的package包/类
private ApplicationDialog createDetailFormDialog()
{
return new TitledApplicationDialog()
{
protected Object[] getCommandGroupMembers()
{
return new AbstractCommand[]{getFinishCommand()};
}
@Override
protected JComponent createTitledDialogContentPane()
{
return detailForm.getControl();
}
@Override
public void setTitle(String title)
{
super.setTitle(title);
setTitlePaneTitle(title);
}
protected boolean onFinish()
{
return true;
}
};
}