List of usage examples for com.vaadin.ui Panel Panel
public Panel(String caption)
From source file:de.catma.ui.analyzer.querybuilder.PhrasePanel.java
License:Open Source License
private Component createSearchPanel() { VerticalLayout searchPanel = new VerticalLayout(); searchPanel.setSpacing(true);// ww w. ja v a 2 s. com wordSequencePanel = new Panel(new HorizontalLayout()); searchPanel.addComponent(wordSequencePanel); WordPanel firstWordPanel = new WordPanel(new ValueChangeListener() { public void valueChange(ValueChangeEvent event) { showInPreviw(); } }); addWordPanel(firstWordPanel); HorizontalLayout buttonPanel = new HorizontalLayout(); Label addWordPanelLabel = new Label("If your phrase contains more words you can"); buttonPanel.addComponent(addWordPanelLabel); buttonPanel.setComponentAlignment(addWordPanelLabel, Alignment.MIDDLE_CENTER); btAddWordPanel = new Button("add another word!"); buttonPanel.addComponent(btAddWordPanel); searchPanel.addComponent(buttonPanel); return searchPanel; }
From source file:de.catma.ui.repository.CorpusPanel.java
License:Open Source License
private Component createCorporaButtonPanel() { Panel corporaButtonsPanel = new Panel(new HorizontalLayout()); corporaButtonsPanel.setStyleName(Reindeer.PANEL_LIGHT); ((HorizontalLayout) corporaButtonsPanel.getContent()).setSpacing(true); btCreateCorpus = new Button("Create Corpus"); corporaButtonsPanel.addComponent(btCreateCorpus); MenuBar menuMoreCorpusActions = new MenuBar(); miMoreCorpusActions = menuMoreCorpusActions.addItem("More actions...", null); miMoreCorpusActions.setEnabled(repository instanceof IndexedRepository); corporaButtonsPanel.addComponent(menuMoreCorpusActions); return corporaButtonsPanel; }
From source file:de.catma.ui.repository.SourceDocumentPanel.java
License:Open Source License
private Component createDocumentButtonsPanel() { Panel documentButtonsPanel = new Panel(new HorizontalLayout()); documentButtonsPanel.setStyleName(Reindeer.PANEL_LIGHT); ((HorizontalLayout) documentButtonsPanel.getContent()).setSpacing(true); btOpenDocument = new Button("Open Document"); documentButtonsPanel.addComponent(btOpenDocument); btAddDocument = new Button("Add Document"); documentButtonsPanel.addComponent(btAddDocument); MenuBar menuMoreDocumentActions = new MenuBar(); miMoreDocumentActions = menuMoreDocumentActions.addItem("More actions...", null); documentButtonsPanel.addComponent(menuMoreDocumentActions); return documentButtonsPanel; }
From source file:de.catma.ui.repository.SourceDocumentPanel.java
License:Open Source License
private Component createContentInfoButtonsPanel() { HorizontalLayout content = new HorizontalLayout(); content.setSpacing(true);//from w w w. j a v a 2 s. c o m Panel contentInfoButtonsPanel = new Panel(content); contentInfoButtonsPanel.setStyleName(Reindeer.PANEL_LIGHT); btEditContentInfo = new Button("Edit"); contentInfoButtonsPanel.addComponent(btEditContentInfo); btSaveContentInfoChanges = new Button("Save"); btSaveContentInfoChanges.setVisible(false); contentInfoButtonsPanel.addComponent(btSaveContentInfoChanges); btDiscardContentInfoChanges = new Button("Discard"); btDiscardContentInfoChanges.setVisible(false); contentInfoButtonsPanel.addComponent(btDiscardContentInfoChanges); return contentInfoButtonsPanel; }
From source file:de.catma.ui.repository.wizard.FileTypePanel.java
License:Open Source License
private void initComponents() { setSpacing(true);//from www . j a v a 2s . c o m setSizeFull(); setMargin(true, false, false, false); cbFileType = new ComboBox("File type"); for (FileType ft : FileType.values()) { cbFileType.addItem(ft); } cbFileType.setNullSelectionAllowed(false); cbFileType.setImmediate(true); addComponent(cbFileType, 0, 0); fileEncodingTree = new Tree("File encoding"); fileEncodingTree.setImmediate(true); Map<String, Map<String, List<Charset>>> regionLanguageCharsetMapping = CharsetLanguageInfo.SINGLETON .getRegionLanguageCharsetMapping(); for (String region : regionLanguageCharsetMapping.keySet()) { fileEncodingTree.addItem(region); Map<String, List<Charset>> languages = regionLanguageCharsetMapping.get(region); for (String language : languages.keySet()) { fileEncodingTree.addItem(language); fileEncodingTree.setParent(language, region); for (Charset charset : languages.get(language)) { fileEncodingTree.addItem(charset); fileEncodingTree.setParent(charset, language); fileEncodingTree.setChildrenAllowed(charset, false); } } } Map<String, List<Charset>> categoryCharsetMapping = CharsetLanguageInfo.SINGLETON .getCategoryCharsetMapping(); for (String category : categoryCharsetMapping.keySet()) { fileEncodingTree.addItem(category); for (Charset charset : categoryCharsetMapping.get(category)) { fileEncodingTree.addItem(charset); fileEncodingTree.setParent(charset, category); fileEncodingTree.setChildrenAllowed(charset, false); } } previewPanel = new Panel("Preview"); previewPanel.getContent().setSizeUndefined(); previewPanel.setHeight("300px"); this.taPreview = new Label(); this.taPreview.setContentMode(Label.CONTENT_XHTML); previewPanel.addComponent(taPreview); addComponent(fileEncodingTree, 0, 1); addComponent(previewPanel, 1, 1); this.uploadLabel = new Label("Upload the corresponding XSLT file:"); this.uploadPanel = new UploadPanel(); addComponent(uploadLabel, 0, 2, 1, 2); addComponent(uploadPanel, 0, 3, 1, 3); progressIndicator = new ProgressIndicator(); progressIndicator.setEnabled(false); progressIndicator.setIndeterminate(true); progressIndicator.setWidth("100%"); progressIndicator.setPollingInterval(500); addComponent(progressIndicator, 1, 0); setColumnExpandRatio(1, 1); }
From source file:de.catma.ui.repository.wizard.IndexerOptionsPanel.java
License:Open Source License
private void initComponents() { setSpacing(true);//from w w w. ja v a 2 s. co m setSizeFull(); Label infoLabel = new Label(); infoLabel.setContentMode(Label.CONTENT_XHTML); infoLabel.setValue("<p>This section allows you to finetune the creation " + "of the word list of your Source Document.</p>" + "<p>If you are unsure what to do, just select the language " + "and leave everything else unmodified.</p>"); addComponent(infoLabel, 0, 0, 2, 0); cbUseApostrophe = new CheckBox("always use the apostrophe as a word separator"); addComponent(cbUseApostrophe, 0, 1, 2, 1); Locale[] all = Locale.getAvailableLocales(); sortedLangs = new TreeSet<LanguageItem>(); for (Locale locale : all) { sortedLangs.add(new LanguageItem(locale)); } languagesListSelect = new ListSelect("Please select the predominant language of the Source Document:", sortedLangs); languagesListSelect.setNullSelectionAllowed(false); languagesListSelect.setSizeFull(); languagesListSelect.setImmediate(true); addComponent(languagesListSelect, 0, 2, 0, 3); unseparableCharacterSequencesListSelect = new ListSelect("Unseparable character sequences:"); unseparableCharacterSequencesListSelect.setNullSelectionAllowed(false); unseparableCharacterSequencesListSelect.setSizeFull(); unseparableCharacterSequencesListSelect.setImmediate(true); addComponent(unseparableCharacterSequencesListSelect, 1, 2, 1, 3); HorizontalLayout ucsAddRemoveLayout = new HorizontalLayout(); Panel ucsAddRemovePanel = new Panel(ucsAddRemoveLayout); ucsAddRemovePanel.setStyleName(Reindeer.PANEL_LIGHT); ucsAddRemoveLayout.setSpacing(true); ucsAddRemoveLayout.setSizeFull(); btAddUcs = new Button("Add entry"); btAddUcs.setEnabled(false); ucsAddRemovePanel.addComponent(btAddUcs); tfUcs = new TextField(); tfUcs.setInputPrompt("Add things like 'e.g.' as you see fit."); tfUcs.setImmediate(true); tfUcs.setTextChangeEventMode(TextChangeEventMode.EAGER); tfUcs.setWidth("100%"); ucsAddRemovePanel.addComponent(tfUcs); ucsAddRemoveLayout.setExpandRatio(tfUcs, 2); btRemoveUcs = new Button("Remove entry"); btRemoveUcs.setEnabled(false); ucsAddRemovePanel.addComponent(btRemoveUcs); addComponent(ucsAddRemovePanel, 1, 4); VerticalLayout loadSavePanel = new VerticalLayout(); loadSavePanel.setSpacing(true); loadSavePanel.setWidth("80px"); btLoadUcsList = new Button("Load list"); loadSavePanel.addComponent(btLoadUcsList); btSaveUcsList = new Button("Save list"); loadSavePanel.addComponent(btSaveUcsList); addComponent(loadSavePanel, 2, 2); setColumnExpandRatio(0, 2); setColumnExpandRatio(1, 2); setRowExpandRatio(2, 2); setRowExpandRatio(3, 2); }
From source file:de.catma.ui.repository.wizard.LocationPanel.java
License:Open Source License
private void initComponents() { setSpacing(true);/* ww w . ja v a 2 s . c o m*/ setMargin(true, false, false, false); setSizeFull(); HorizontalLayout remoteLayout = new HorizontalLayout(); remoteLayout.setMargin(true); remoteLayout.setSpacing(true); remoteLayout.setSizeFull(); remoteURIInputPanel = new Panel(remoteLayout); remoteURIInput = new TextField(); remoteURIInput.setCaption("Enter an URI that is accessible over the internet:"); remoteURIInput.setWidth("100%"); remoteURIInput.setTextChangeEventMode(TextChangeEventMode.EAGER); remoteURIInputPanel.addComponent(remoteURIInput); remoteLayout.setExpandRatio(remoteURIInput, 2); addComponent(remoteURIInputPanel); Label localFileLabel = new Label("or upload a local file from your computer:"); addComponent(localFileLabel); uploadPanel = new UploadPanel(); addComponent(uploadPanel); }
From source file:de.fatalix.bookery.view.login.LoginView.java
License:Open Source License
private Component buildLoginForm() { FormLayout loginForm = new FormLayout(); loginForm.addStyleName("login-form"); loginForm.setSizeUndefined();/*from w ww .j a v a 2 s . co m*/ loginForm.setMargin(false); loginForm.addComponent(username = new TextField("Username", "admin")); username.setWidth(15, Unit.EM); loginForm.addComponent(password = new PasswordField("Password")); password.setWidth(15, Unit.EM); password.setDescription(""); CssLayout buttons = new CssLayout(); buttons.setStyleName("buttons"); loginForm.addComponent(buttons); login = new Button("login"); buttons.addComponent(login); login.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { try { presenter.doLogin(username.getValue(), password.getValue()); } catch (AuthenticationException ex) { LoginView.this.showNotification( new Notification("Wrong login", Notification.Type.ERROR_MESSAGE), ValoTheme.NOTIFICATION_FAILURE); } finally { login.setEnabled(true); } } }); login.addStyleName(ValoTheme.BUTTON_FRIENDLY); buttons.addComponent(forgotPassword = new Button("Forgot password?")); forgotPassword.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { showNotification(new Notification("Hint: Ask me", Notification.Type.HUMANIZED_MESSAGE), ValoTheme.NOTIFICATION_SUCCESS); } }); forgotPassword.addStyleName(ValoTheme.BUTTON_LINK); Panel loginPanel = new Panel(loginForm); loginPanel.setWidthUndefined(); loginPanel.addStyleName(ValoTheme.PANEL_BORDERLESS); loginPanel.addAction(new ShortcutListener("commit", ShortcutAction.KeyCode.ENTER, null) { @Override public void handleAction(Object sender, Object target) { try { presenter.doLogin(username.getValue(), password.getValue()); } catch (AuthenticationException ex) { LoginView.this.showNotification( new Notification("Wrong login", Notification.Type.ERROR_MESSAGE), ValoTheme.NOTIFICATION_FAILURE); } } }); return loginPanel; }
From source file:de.fatalix.lighty.web.LightyApp.java
@Override protected void init(VaadinRequest request) { setSizeFull();// w ww . j a va 2s.c o m VerticalLayout navigatorLayout = new VerticalLayout(); navigatorLayout.setSizeFull(); navigatorLayout.setSpacing(true); Panel contentPanel = new Panel(navigatorLayout); contentPanel.setSizeFull(); contentPanel.addStyleName(LightyTheme.BACKGROUND); Navigator navigator = new Navigator(LightyApp.this, contentPanel); navigator.addProvider(viewProvider); VerticalLayout rootLayout = new VerticalLayout(); rootLayout.addComponent(new LightyHeader()); rootLayout.addComponent(new LightyNavigation()); rootLayout.addComponent(notificationBar); rootLayout.addComponent(contentPanel); rootLayout.setExpandRatio(contentPanel, 1.0f); rootLayout.setSizeFull(); setContent(rootLayout); }
From source file:de.fatalix.timeline.web.VaadinWebProjectApp.java
@Override protected void init(VaadinRequest request) { setSizeFull();/*from ww w. ja v a 2 s. c om*/ VerticalLayout navigatorLayout = new VerticalLayout(); navigatorLayout.setSizeFull(); navigatorLayout.setSpacing(true); Panel contentPanel = new Panel(navigatorLayout); contentPanel.setSizeFull(); Navigator navigator = new Navigator(VaadinWebProjectApp.this, contentPanel); navigator.addProvider(viewProvider); VerticalLayout rootLayout = new VerticalLayout(); //rootLayout.addComponent(header); rootLayout.addComponent(contentPanel); rootLayout.setExpandRatio(contentPanel, 1.0f); rootLayout.setSizeFull(); setContent(rootLayout); }