Java 类com.google.gwt.user.client.ui.TabLayoutPanel 实例源码
项目:platypus-js
文件:TabbedPane.java
public TabLabel(final TabLayoutPanel aParentTabs, final Widget subject, String aText, boolean asHtml, ImageResource aImage) {
label = new ImageLabel(aText, asHtml, aImage);
closer.getElement().getStyle().setDisplay(Style.Display.INLINE_BLOCK);
closer.getElement().getStyle().setVerticalAlign(Style.VerticalAlign.TOP);
closer.getElement().addClassName("tab-close-tool");
closer.addDomHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
aParentTabs.remove(subject);
}
}, ClickEvent.getType());
add(label);
add(closer);
label.setImageResource(aImage);
}
项目:gwtinaction2
文件:BasicProject.java
/**
* We'll build the tab panel's content from the HTML that is already in the HTML
* page.
*/
private void buildTabContent(){
// Create the main content widget
// First retrieve the existing content for the pages from the HTML page
this.homePanel = new HTMLPanel(getContent(Pages.HOME.getText()));
this.productsPanel = new HTMLPanel(getContent(Pages.PRODUCTS.getText()));
this.contactPanel = new HTMLPanel(getContent(Pages.CONTACT.getText()));
// set the style of HTMLPanels
this.homePanel.addStyleName("htmlPanel");
this.productsPanel.addStyleName("htmlPanel");
this.contactPanel.addStyleName("htmlPanel");
// Create the tab panel widget
this.content = new TabLayoutPanel(20, Unit.PX);
// Add the content we have just created to the tab panel widget
this.content.add(this.homePanel, Pages.HOME.getText());
this.content.add(this.productsPanel, Pages.PRODUCTS.getText());
this.content.add(this.contactPanel, Pages.CONTACT.getText());
// Indicate that we should show the HOME tab initially.
this.content.selectTab(DECK_HOME);
}
项目:gwt-ol3
文件:GwtOL3Playground.java
@Override
public void onModuleLoad() {
Map<String, Integer> exampleIndexMap = new HashMap<>();
// choose your example
TabLayoutPanel tabs = new TabLayoutPanel(27, Style.Unit.PX);
int index = 0;
for (OL3ExampleType example : OL3ExampleType.values()) {
tabs.add(new LazyExampleWidget(example), example.name().replace("Example", ""));
exampleIndexMap.put(example.name(), index);
index++;
}
RootLayoutPanel.get().add(tabs);
String token = History.getToken();
if (token != null && exampleIndexMap.containsKey(token)) {
tabs.selectTab(exampleIndexMap.get(token));
}
}
项目:geomajas-project-hammer-gwt
文件:HammerGwtExample.java
@Override
public void onModuleLoad() {
// Create a tab panel
tabPanel = new TabLayoutPanel(2.5, Style.Unit.EM);
tabPanel.setAnimationDuration(1000);
tabPanel.getElement().getStyle().setMarginBottom(10.0, Style.Unit.PX);
// Add event logger sample
addTab(new EventLoggerSample());
// Add a tab gwt panels
addTab(new PanelsSample());
tabPanel.selectTab(0);
RootLayoutPanel.get().add(tabPanel);
}
项目:rosa
文件:SequenceView.java
public SequenceView() {
main = new FlowPanel();
main.setStylePrimaryName("View");
this.thumb_browser = new ThumbnailBrowser();
this.page_turner = new PageTurner();
this.tab_panel = new TabLayoutPanel(2, Unit.EM);
tab_panel.setStylePrimaryName("SequenceViewTabPanel");
tab_panel.add(page_turner, Messages.INSTANCE.pageTurner());
tab_panel.add(thumb_browser, Messages.INSTANCE.thumbnailBrowser());
main.add(tab_panel);
tab_panel.selectTab(0);
addContent(main);
}
项目:rosa
文件:App.java
private void displayNarrativeSections(TabLayoutPanel tabpanel, int image) {
NarrativeTagging narmap = book.narrativeMap();
List<Integer> indexes = narmap.findImageIndexes(book, image);
// Tab name -> panel, one for each column
HashMap<String, Panel> newtabs = new HashMap<String, Panel>(2);
String imagename = Book.shortImageName(book.imageName(image));
for (int section : indexes) {
String tabname = imagename + "." + narmap.startColumn(section);
Panel p = newtabs.get(tabname);
if (p == null) {
p = new FlowPanel();
newtabs.put(tabname, p);
tabpanel.add(new ScrollPanel(p), tabname);
}
p.add(narmap.displaySection(section, narsecs));
}
}
项目:GWTModelWeight
文件:InfoPanelTab.java
public InfoPanelTab(){
TabLayoutPanel tab=new TabLayoutPanel(30, Unit.PX);
add(tab);
tab.setWidth("100%");
tab.setHeight("100%");
tab.add(createBVHBonePanel(),"BVH(Bone)");
tab.add(createBVHAnimationPanel(),"BVH(A-Bone)");
tab.add(createGeometryAnimationPanel(),"Geometry(A-Bone)");
}
项目:GWTMarkdownEditor
文件:MarkdownEditor.java
private void createRightPanels() {
DockLayoutPanel rightPanel=new DockLayoutPanel(Unit.PX);
rightPanel.setSize("100%", "100%");
this.add(rightPanel);
createOptionArea(rightPanel);
rightTabPanel = new TabLayoutPanel(40,Unit.PX);
rightPanel.add(rightTabPanel);
rightTabPanel.setSize("100%","100%");
createPreviewArea(rightTabPanel);
createHtmlArea(rightTabPanel);
rightTabPanel.selectTab(0);
}
项目:GWTMarkdownEditor
文件:MarkdownEditor.java
private void createPreviewArea(TabLayoutPanel tab) {
previewPanel = new VerticalPanel();//really need?
previewPanel.setSize("100%","100%");
ScrollPanel scroll=new ScrollPanel();
scroll.setWidth("100%");
previewPanel.add(scroll);
scroll.setHeight("100%");
previewHTML = new HTML();
//scroll.setWidget(previewHTML);
scroll.setWidget(htmlContainer);
tab.add(previewPanel,"Preview");
}
项目:GWTMarkdownEditor
文件:MarkdownEditor.java
private void createHtmlArea(TabLayoutPanel tab) {
VerticalPanel container=new VerticalPanel();
container.setSize("100%", "100%");
htmlArea = new TextArea();
htmlArea.setWidth("95%");
htmlArea.setHeight("100%");
container.add(htmlArea);
tab.add(container,"HTML");
}
项目:Peergos
文件:CwTabLayoutPanel.java
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a tab panel
TabLayoutPanel tabPanel = new TabLayoutPanel(2.5, Unit.EM);
tabPanel.setAnimationDuration(1000);
tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
// Add a home tab
String[] tabTitles = constants.cwTabPanelTabs();
HTML homeText = new HTML(constants.cwTabPanelTab0());
tabPanel.add(homeText, tabTitles[0]);
// Add a tab with an image
SimplePanel imageContainer = new SimplePanel();
imageContainer.setWidget(new Image(Showcase.images.gwtLogo()));
tabPanel.add(imageContainer, tabTitles[1]);
// Add a tab
HTML moreInfo = new HTML(constants.cwTabPanelTab2());
tabPanel.add(moreInfo, tabTitles[2]);
// Return the content
tabPanel.selectTab(0);
tabPanel.ensureDebugId("cwTabPanel");
return tabPanel;
}
项目:swarm
文件:CwTabLayoutPanel.java
/**
* Initialize this example.
*/
@ShowcaseSource
@Override
public Widget onInitialize() {
// Create a tab panel
TabLayoutPanel tabPanel = new TabLayoutPanel(2.5, Unit.EM);
tabPanel.setAnimationDuration(1000);
tabPanel.getElement().getStyle().setMarginBottom(10.0, Unit.PX);
// Add a home tab
String[] tabTitles = constants.cwTabPanelTabs();
HTML homeText = new HTML(constants.cwTabPanelTab0());
tabPanel.add(homeText, tabTitles[0]);
// Add a tab with an image
SimplePanel imageContainer = new SimplePanel();
imageContainer.setWidget(new Image(Showcase.images.gwtLogo()));
tabPanel.add(imageContainer, tabTitles[1]);
// Add a tab
HTML moreInfo = new HTML(constants.cwTabPanelTab2());
tabPanel.add(moreInfo, tabTitles[2]);
// Return the content
tabPanel.selectTab(0);
tabPanel.ensureDebugId("cwTabPanel");
return tabPanel;
}
项目:rosa
文件:TranscriptionViewer.java
public static TabLayoutPanel createTranscriptionViewer(String[] transxml,
final String[] transnames, final int height, boolean lecoy) {
final TabLayoutPanel tabs = new TabLayoutPanel(1.5, Unit.EM);
tabs.addStyleName("Transcription");
for (int i = 0; i < transxml.length; i++) {
String xml = transxml[i];
String name = transnames[i];
if (xml != null) {
try {
Document doc = XMLParser.parse(xml);
com.google.gwt.dom.client.Document htmldoc = com.google.gwt.dom.client.Document
.get();
displayTranscription(tabs, htmldoc, null, name, doc
.getDocumentElement(), height, lecoy);
} catch (DOMParseException e) {
tabs.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
name);
// TODO
Window.alert("Error parsing xml: " + e);
}
} else {
tabs
.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
name);
}
}
tabs.selectTab(0);
return tabs;
}
项目:rosa
文件:App.java
private void displayIllustrationKeywords(TabLayoutPanel tabpanel, int image) {
ImageTagging illus = book.illustrations();
int count = 1;
List<Integer> indexes = illus.findImageIndexes(image);
for (int i : indexes) {
String name = Book.shortImageName(book.imageName(image)) + (indexes.size() > 1 ? " " + count++ : "");
tabpanel.add(new ScrollPanel(illus.displayImage(i)), name);
}
}
项目:rosa
文件:TranscriptionViewer.java
public static TabLayoutPanel createTranscriptionViewer(String[] transxml,
final String[] transnames, final int height, boolean lecoy) {
final TabLayoutPanel tabs = new TabLayoutPanel(1.5, Unit.EM);
tabs.addStyleName("Transcription");
for (int i = 0; i < transxml.length; i++) {
String xml = transxml[i];
String name = transnames[i];
if (xml != null) {
try {
Document doc = XMLParser.parse(xml);
com.google.gwt.dom.client.Document htmldoc = com.google.gwt.dom.client.Document
.get();
displayTranscription(tabs, htmldoc, null, name, doc
.getDocumentElement(), height, lecoy);
} catch (DOMParseException e) {
tabs.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
name);
// TODO
Window.alert("Error parsing xml: " + e);
}
} else {
tabs
.add(new Label(Labels.INSTANCE.transcriptionUnavailable()),
name);
}
}
tabs.selectTab(0);
return tabs;
}
项目:rosa
文件:App.java
private void displayIllustrationKeywords(TabLayoutPanel tabpanel, int image) {
ImageTagging illus = book.illustrations();
int count = 1;
List<Integer> indexes = illus.findImageIndexes(image);
for (int i : indexes) {
String name = Book.shortImageName(book.imageName(image))
+ (indexes.size() > 1 ? " " + count++ : "");
tabpanel.add(new ScrollPanel(illus.displayImage(i)), name);
}
}
项目:CAVilLag
文件:CAVilLag.java
public void onModuleLoad() {
instance = this;
categories = new HashMap<String, CategoryPanel>();
selectedNodes = new HashMap<String, Boolean>();
controller = new PickupDragController(RootPanel.get(), false);
main = new TabLayoutPanel(3.0, Unit.EM);
loadTabs();
main.setHeight(Window.getClientHeight()+"px");
RootPanel.get().add(main);
}
项目:EasyML
文件:PreviewPopupPanel.java
public TabLayoutPanel getTabPanel() {
return tabPanel;
}
项目:EasyML
文件:PreviewPopupPanel.java
public void setTabPanel(TabLayoutPanel tabPanel) {
this.tabPanel = tabPanel;
}
项目:document-management-system
文件:TabDocument.java
/**
* The Document tab
*/
public TabDocument() {
doc = new GWTDocument();
propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
document = new Document();
notes = new Notes(Notes.DOCUMENT_NOTE);
version = new VersionScrollTable();
security = new SecurityScrollTable();
preview = new Preview(null);
panel = new VerticalPanel();
propertyGroup = new ArrayList<PropertyGroup>();
widgetExtensionList = new ArrayList<TabDocumentExtension>();
docHandlerExtensionList = new ArrayList<DocumentHandlerExtension>();
tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(SelectionEvent<Integer> event) {
final int tabIndex = event.getSelectedItem().intValue();
Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
selectedTab = tabIndex;
if (tabIndex == SECURITY_TAB) {
Timer timer = new Timer() {
@Override
public void run() {
security.fillWidth(); // Always when shows fires fill width
}
};
timer.schedule(500); // Fill width must be done after really it'll be visible
}
preview.cleanPreview(); // Always clean preview tab
if (tabIndex == PREVIEW_TAB) {
Timer previewTimer = new Timer() {
@Override
public void run() {
previewDocument(false);
}
};
previewTimer.schedule(500);
}
fireEvent(HasDocumentEvent.TAB_CHANGED);
}
});
panel.add(tabPanel);
tabPanel.setWidth("100%");
document.setSize("100%", "100%");
notes.setSize("100%", "100%");
panel.setSize("100%", "100%");
tabPanel.setStyleName("okm-DisableSelect");
initWidget(panel);
}
项目:document-management-system
文件:TabMail.java
/**
* The Document tab
*/
public TabMail() {
widgetExtensionList = new ArrayList<TabMailExtension>();
mailHandlerExtensionList = new ArrayList<MailHandlerExtension>();
propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
mail = new Mail();
notes = new Notes(Notes.MAIL_NOTE);
mailViewer = new MailViewer();
security = new SecurityScrollTable();
panel = new VerticalPanel();
propertyGroup = new ArrayList<PropertyGroup>();
tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(SelectionEvent<Integer> event) {
int tabIndex = event.getSelectedItem().intValue();
Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
selectedTab = tabIndex;
if (tabIndex == SECURITY_TAB) {
Timer timer = new Timer() {
@Override
public void run() {
security.fillWidth(); // Always when shows fires fill width
}
};
timer.schedule(500); // Fill width must be done after really it'll be visible
}
fireEvent(HasMailEvent.TAB_CHANGED);
}
});
panel.add(tabPanel);
tabPanel.setWidth("100%");
mail.setSize("100%", "100%");
notes.setSize("100%", "100%");
mailViewer.setSize("100%", "100%");
panel.setSize("100%", "100%");
tabPanel.setStyleName("okm-DisableSelect");
initWidget(panel);
}
项目:document-management-system
文件:TabFolder.java
/**
* TabFolder
*/
public TabFolder() {
widgetExtensionList = new ArrayList<TabFolderExtension>();
folderHandlerExtensionList = new ArrayList<FolderHandlerExtension>();
propertyGroupHandlerExtensionList = new ArrayList<PropertyGroupHandlerExtension>();
tabPanel = new TabLayoutPanel(TAB_HEIGHT, Unit.PX);
folder = new Folder();
security = new SecurityScrollTable();
notes = new Notes(Notes.FOLDER_NOTE);
panel = new VerticalPanel();
propertyGroup = new ArrayList<PropertyGroup>();
tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
public void onSelection(SelectionEvent<Integer> event) {
int tabIndex = event.getSelectedItem().intValue();
Main.get().mainPanel.topPanel.toolBar.evaluateRemovePropertyGroup(isRemovePropertyGroupEnabled(tabIndex));
selectedTab = tabIndex;
if (tabIndex == SECURITY_TAB) {
Timer timer = new Timer() {
@Override
public void run() {
security.fillWidth(); // Always when shows fires fill width
}
};
timer.schedule(500); // Fill width must be done after really it'll be visible
}
fireEvent(HasFolderEvent.TAB_CHANGED);
}
});
panel.add(tabPanel);
tabPanel.setWidth("100%");
folder.setSize("100%", "100%");
notes.setSize("100%", "100%");
panel.setSize("100%", "100%");
tabPanel.setStyleName("okm-DisableSelect");
initWidget(panel);
}
项目:WebGL4J
文件:WebGL4J.java
@Override
public void onModuleLoad()
{
RootLayoutPanel.get().add(new HTML(
"<img style='float: left; padding: 10px;'" +
" src='https://goharsha.com/WebGL4J/logos/128/logo-green-dark.png'></img>" +
"<h1 style='padding-left: 20px; font-size: 65px;'>" +
" Examples</h1>"));
examples = new ArrayList<>();
tabs = new TabLayoutPanel(190, Style.Unit.PX);
tabs.add(new ScrollPanel(createInformationTab()), "Information");
Example triangleExample = new TriangleExample(createCanvas());
examples.add(triangleExample);
tabs.add(triangleExample.canvas, "Triangle");
Example rectangleExample = new RectangleExample(createCanvas());
examples.add(rectangleExample);
tabs.add(rectangleExample.canvas, "Rectangle");
Example textureExample = new TextureExample(createCanvas());
examples.add(textureExample);
tabs.add(textureExample.canvas, "Texture");
Example cubeExample = new CubeExample(createCanvas());
examples.add(cubeExample);
tabs.add(cubeExample.canvas, "Cube");
Example texturedCubeExample = new TexturedCubeExample(createCanvas());
examples.add(texturedCubeExample);
tabs.add(texturedCubeExample.canvas, "Textured Cube");
RootLayoutPanel.get().add(tabs);
// Init all examples
for (Example example : examples)
{
example.context.makeCurrent();
example.init();
}
AnimationScheduler.get().requestAnimationFrame(this::animationCallback);
}
项目:firefly
文件:TabPane.java
public TabLayoutPanel getInternalTabPanel() {
return tabPanel;
}
项目:platypus-js
文件:TabbedPane.java
public TabLayoutPanel getTabs(){
return tabs;
}
项目:GWTMarkdownEditor
文件:MarkdownEditor.java
public TabLayoutPanel getRightTabPanel(){
return rightTabPanel;
}
项目:rosa
文件:App.java
private void displayIllustrationKeywordsOnRight(final Panel container) {
int recto = -1;
int verso = -1;
ImageTagging illus = book.illustrations();
if (illus == null) {
String illusurl = GWT.getHostPageBaseURL() + DATA_PATH + book.illustrationsPath();
loadingdialog.display();
HttpGet.request(illusurl, new HttpGet.Callback<String>() {
public void failure(String error) {
loadingdialog.error(error);
}
public void success(String result) {
loadingdialog.hide();
book.setIllustrations(result);
if (book.illustrations() != null) {
displayIllustrationKeywordsOnRight(container);
}
}
});
} else {
if (Book.isRectoImage(selectedImageIndex)) {
recto = selectedImageIndex;
if (recto > 0) {
verso = selectedImageIndex - 1;
}
} else {
if (selectedImageIndex + 1 < book.numImages()) {
recto = selectedImageIndex + 1;
}
verso = selectedImageIndex;
}
TabLayoutPanel tabpanel = new TabLayoutPanel(1.5, Unit.EM);
tabpanel.addStyleName("ImageDescription");
if (verso != -1) {
displayIllustrationKeywords(tabpanel, verso);
}
if (recto != -1) {
displayIllustrationKeywords(tabpanel, recto);
}
if (tabpanel.getWidgetCount() > 0) {
tabpanel.selectTab(0);
container.add(tabpanel);
}
}
}
项目:rosa
文件:App.java
private void displayIllustrationKeywordsOnRight(final Panel container) {
int recto = -1;
int verso = -1;
ImageTagging illus = book.illustrations();
if (illus == null) {
String illusurl = GWT.getHostPageBaseURL() + DATA_PATH
+ book.illustrationsPath();
loadingdialog.display();
HttpGet.request(illusurl, new HttpGet.Callback<String>() {
public void failure(String error) {
loadingdialog.error(error);
}
public void success(String result) {
loadingdialog.hide();
book.setIllustrations(result);
if (book.illustrations() != null) {
displayIllustrationKeywordsOnRight(container);
}
}
});
} else {
if (Book.isRectoImage(selectedImageIndex)) {
recto = selectedImageIndex;
if (recto > 0) {
verso = selectedImageIndex - 1;
}
} else {
if (selectedImageIndex + 1 < book.numImages()) {
recto = selectedImageIndex + 1;
}
verso = selectedImageIndex;
}
TabLayoutPanel tabpanel = new TabLayoutPanel(1.5, Unit.EM);
tabpanel.addStyleName("ImageDescription");
if (verso != -1) {
displayIllustrationKeywords(tabpanel, verso);
}
if (recto != -1) {
displayIllustrationKeywords(tabpanel, recto);
}
if (tabpanel.getWidgetCount() > 0) {
tabpanel.selectTab(0);
container.add(tabpanel);
}
}
}
项目:ephesoft
文件:LandingView.java
/**
* To get Review Validate TabLayout Panel.
*
* @return TabLayoutPanel
*/
public TabLayoutPanel getReviewValidateTabLayoutPanel() {
return reviewValidateTabLayoutPanel;
}
项目:wbi
文件:TabCoordinator.java
/**
* Initialize {@code TabCoordinator}.
*
* @param manager {@code Manager} to attach views to.
* @param panel {@code TabLayoutPanel} to listen to.
*/
public TabCoordinator(T manager, TabLayoutPanel panel) {
super(manager);
this.panel = panel;
this.panel.addSelectionHandler(this);
}
项目:wbi
文件:TabCoordinator.java
/**
* Get underlying {@code TabLayoutPanel}.
*
* @return Underlying tab panel.
*/
public TabLayoutPanel getPanel() {
return panel;
}