Example usage for com.vaadin.ui Panel Panel

List of usage examples for com.vaadin.ui Panel Panel

Introduction

In this page you can find the example usage for com.vaadin.ui Panel Panel.

Prototype

public Panel() 

Source Link

Document

Creates a new empty panel.

Usage

From source file:org.activiti.explorer.ui.process.simple.editor.SimpleTableEditor.java

License:Apache License

protected void showDiagram() {
    StreamResource.StreamSource streamSource = new StreamSource() {

        private static final long serialVersionUID = 6993112534181068935L;

        public InputStream getStream() {
            WorkflowDefinitionConversion workflowDefinitionConversion = ExplorerApp.get()
                    .getWorkflowDefinitionConversionFactory()
                    .createWorkflowDefinitionConversion(createWorkflow());
            final ProcessEngineImpl defaultProcessEngine = (ProcessEngineImpl) ProcessEngines
                    .getDefaultProcessEngine();
            final ProcessEngineConfiguration processEngineConfiguration = defaultProcessEngine
                    .getProcessEngineConfiguration();
            final ProcessDiagramGenerator diagramGenerator = processEngineConfiguration
                    .getProcessDiagramGenerator();

            return diagramGenerator.generateDiagram(workflowDefinitionConversion.getBpmnModel(), "png",
                    processEngineConfiguration.getActivityFontName(),
                    processEngineConfiguration.getLabelFontName(), processEngineConfiguration.getClassLoader());
        }//from   w  w  w.  ja v  a2 s . c  o  m
    };

    // resource must have unique id (or cache-crap can happen)!
    StreamResource imageresource = new StreamResource(streamSource, UUID.randomUUID() + ".png",
            ExplorerApp.get());
    Embedded diagram = new Embedded("", imageresource);
    diagram.setType(Embedded.TYPE_IMAGE);
    diagram.setSizeUndefined();

    imagePanel = new Panel(); // using panel for scrollbars
    imagePanel.setScrollable(true);
    imagePanel.addStyleName(Reindeer.PANEL_LIGHT);
    imagePanel.setWidth(100, UNITS_PERCENTAGE);
    imagePanel.setHeight("100%");
    mainLayout.addComponent(imagePanel);

    HorizontalLayout panelLayout = new HorizontalLayout();
    panelLayout.setSizeUndefined();
    imagePanel.setContent(panelLayout);
    imagePanel.addComponent(diagram);
}

From source file:org.activiti.explorer.ui.profile.ProfilePanel.java

License:Apache License

protected void initInformationPanel() {
    Panel infoPanel = new Panel();
    infoPanel.addStyleName(Reindeer.PANEL_LIGHT);
    infoPanel.setSizeFull();//from  w  w w .j  a v  a 2s.co  m

    profilePanelLayout.addComponent(infoPanel);
    profilePanelLayout.setExpandRatio(infoPanel, 1.0f); // info panel should take all the remaining width available

    // All the information sections are put under each other in a vertical layout
    this.infoPanelLayout = new VerticalLayout();
    infoPanel.setContent(infoPanelLayout);

    initAboutSection();
    initContactSection();

}

From source file:org.activiti.explorer.ui.task.SubTaskComponent.java

License:Apache License

protected void initAddSubTaskPanel(HorizontalLayout headerLayout) {
    // The add button is placed in a panel, so we can catch 'enter' and 'escape' events
    addSubTaskPanel = new Panel();
    addSubTaskPanel.setContent(new VerticalLayout());
    addSubTaskPanel.setSizeUndefined();// ww w. jav a  2s.c o m
    addSubTaskPanel.addStyleName(Reindeer.PANEL_LIGHT);
    addSubTaskPanel.addStyleName("no-border");
    headerLayout.addComponent(addSubTaskPanel);

    initAddSubTaskPanelKeyboardActions();
    initAddButton();
}

From source file:org.activiti.explorer.ui.task.TaskEventsPanel.java

License:Apache License

protected void addInputField() {
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSpacing(true);/*w  ww.  j ava 2  s. c om*/
    layout.setWidth(100, UNITS_PERCENTAGE);
    addComponent(layout);

    Panel textFieldPanel = new Panel(); // Hack: actionHandlers can only be attached to panels or windows
    textFieldPanel.addStyleName(Reindeer.PANEL_LIGHT);
    textFieldPanel.setContent(new VerticalLayout());
    textFieldPanel.setWidth(100, UNITS_PERCENTAGE);
    layout.addComponent(textFieldPanel);
    layout.setExpandRatio(textFieldPanel, 1.0f);

    commentInputField = new TextField();
    commentInputField.setWidth(100, UNITS_PERCENTAGE);
    textFieldPanel.addComponent(commentInputField);

    // Hack to catch keyboard 'enter'
    textFieldPanel.addActionHandler(new Handler() {
        public void handleAction(Action action, Object sender, Object target) {
            addNewComment(commentInputField.getValue().toString());
        }

        public Action[] getActions(Object target, Object sender) {
            return new Action[] { new ShortcutAction("enter", ShortcutAction.KeyCode.ENTER, null) };
        }
    });

    Button addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    layout.addComponent(addCommentButton);
    layout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}

From source file:org.activiti.kickstart.KickStartApplication.java

License:Apache License

protected void initMainWindow() {

    Window mainWindow = new Window(TITLE);
    setMainWindow(mainWindow);//from   w w  w  .  j a v a  2s.c o m
    Panel p = new Panel();
    p.setSizeFull();
    mainWindow.setContent(p);

    mainLayout = new CustomLayout(THEME_NAME); // uses layout defined in webapp/Vaadin/themes/yakalo
    mainLayout.setSizeFull();
    p.setContent(mainLayout);

    initSplitPanel();
    initViewManager();
    initActionsPanel();
}

From source file:org.activiti.kickstart.ui.panel.KickstartWorkflowPanel.java

License:Apache License

protected void initButtons(GridLayout layout) {
    final Button saveButton = new Button("Save");
    saveButton.setEnabled(nameField.getValue() != null && !"".equals((String) nameField.getValue()));
    saveButton.setIcon(saveImage);//from w w  w .  j  a  v  a2  s.co  m
    saveButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 3546324122090420533L;

        public void buttonClick(ClickEvent event) {
            try {
                adhocWorkflowService.deployKickstartWorkflow(createAdhocWorkflow());
                Panel successPanel = new Panel();
                successPanel.setStyleName(Reindeer.PANEL_LIGHT);
                Label successLabel = new Label("Process successfully deployed");
                successPanel.addComponent(successLabel);
                viewManager.switchWorkArea(ViewManager.PROCESS_SUCESSFULLY_DEPLOYED, successPanel);
            } catch (Exception e) {
                e.printStackTrace();
                viewManager.showPopupWindow(new ErrorPopupWindow(e));
            }
        }
    });

    // Dependending on namefield value, save button is enabled
    nameField.addListener(new ValueChangeListener() {
        private static final long serialVersionUID = -4357300368046546003L;

        public void valueChange(ValueChangeEvent event) {
            if (nameField.getValue() != null && !"".equals((String) nameField.getValue())) {
                saveButton.setEnabled(true);
            } else {
                saveButton.setEnabled(false);
            }
        }
    });

    Button generateImageButton = new Button("View image");
    generateImageButton.setIcon(generateImageImage);
    generateImageButton.addListener(new Button.ClickListener() {

        private static final long serialVersionUID = 5671158538486627690L;

        public void buttonClick(ClickEvent event) {
            viewManager.showPopupWindow(new ProcessImagePopupWindow(viewManager, createAdhocWorkflow()));
        }

    });

    HorizontalLayout footer = new HorizontalLayout();
    footer.setSpacing(true);
    footer.addComponent(saveButton);
    footer.addComponent(generateImageButton);
    layout.addComponent(new Label());
    layout.addComponent(footer);
}

From source file:org.activiti.kickstart.ui.popup.ProcessImagePopupWindow.java

License:Apache License

protected void initUi() {
    setModal(true);//  w w  w . j  a  v a 2s .c  o  m
    setHeight("80%");
    setWidth("80%");
    center();
    setCaption(TITLE);

    StreamResource.StreamSource streamSource = null;
    if (processDefinitionId != null) {
        streamSource = new StreamSource() {

            private static final long serialVersionUID = -8875067466181823014L;

            public InputStream getStream() {
                return adhocWorkflowService.getProcessImage(processDefinitionId);
            }
        };
    } else if (adhocWorkflow != null) {
        final ProcessDiagramGenerator converter = new ProcessDiagramGenerator(adhocWorkflow);
        streamSource = new StreamSource() {

            private static final long serialVersionUID = 239500411112658830L;

            public InputStream getStream() {
                return converter.execute();
            }
        };
    }

    // resource must have unique id!
    StreamResource imageresource = new StreamResource(streamSource, UUID.randomUUID() + ".png",
            viewManager.getApplication());
    Panel panel = new Panel();
    panel.setContent(new HorizontalLayout());
    panel.setStyleName(Reindeer.PANEL_LIGHT);
    panel.setHeight("95%");
    Embedded embedded = new Embedded("", imageresource);
    embedded.setType(Embedded.TYPE_IMAGE);
    panel.addComponent(embedded);
    addComponent(panel);
}

From source file:org.apache.openaz.xacml.admin.view.components.RangeEditorComponent.java

License:Apache License

@AutoGenerated
private Panel buildPanelTester() {
    // common part: create layout
    panelTester = new Panel();
    panelTester.setCaption("Test Range Values");
    panelTester.setImmediate(true);//from   w  ww .  ja v a 2s .  co m
    panelTester.setWidth("-1px");
    panelTester.setHeight("-1px");

    // verticalLayout_2
    verticalLayout_2 = buildVerticalLayout_2();
    panelTester.setContent(verticalLayout_2);

    return panelTester;
}

From source file:org.apache.openaz.xacml.admin.view.components.RegexpEditorComponent.java

License:Apache License

@AutoGenerated
private Panel buildPanelTester() {
    // common part: create layout
    panelTester = new Panel();
    panelTester.setCaption("Test The Expression");
    panelTester.setImmediate(false);/*from   w w  w  .j  a  va2  s . c om*/
    panelTester.setWidth("-1px");
    panelTester.setHeight("-1px");

    // verticalLayout_2
    verticalLayout_2 = buildVerticalLayout_2();
    panelTester.setContent(verticalLayout_2);

    return panelTester;
}

From source file:org.apache.tamaya.ui.ApplicationLayout.java

License:Apache License

private void initLayouts() {
    navBar = new NavBar(this);
    // Use panel as main content container to allow it's content to scroll
    content = new Panel();
    content.setSizeFull();//from   w  w  w.  ja v  a2  s .c om
    content.addStyleName(UIConstants.PANEL_BORDERLESS);

    addComponents(navBar, content);
    setExpandRatio(content, 1);
}