root / src / gr / grnet / pithos / web / client / TopPanel.java @ ea30dad9
History | View | Annotate | Download (3.6 kB)
1 | a57faaf0 | Christos Stathis | /*
|
---|---|---|---|
2 | cae2a8db | Christos Stathis | * Copyright 2011-2012 GRNET S.A. All rights reserved.
|
3 | 63366925 | Christos Stathis | *
|
4 | 63366925 | Christos Stathis | * Redistribution and use in source and binary forms, with or
|
5 | 63366925 | Christos Stathis | * without modification, are permitted provided that the following
|
6 | 63366925 | Christos Stathis | * conditions are met:
|
7 | 63366925 | Christos Stathis | *
|
8 | 63366925 | Christos Stathis | * 1. Redistributions of source code must retain the above
|
9 | 63366925 | Christos Stathis | * copyright notice, this list of conditions and the following
|
10 | 63366925 | Christos Stathis | * disclaimer.
|
11 | 63366925 | Christos Stathis | *
|
12 | 63366925 | Christos Stathis | * 2. Redistributions in binary form must reproduce the above
|
13 | 63366925 | Christos Stathis | * copyright notice, this list of conditions and the following
|
14 | 63366925 | Christos Stathis | * disclaimer in the documentation and/or other materials
|
15 | 63366925 | Christos Stathis | * provided with the distribution.
|
16 | 63366925 | Christos Stathis | *
|
17 | 63366925 | Christos Stathis | * THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
|
18 | 63366925 | Christos Stathis | * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
19 | 63366925 | Christos Stathis | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
20 | 63366925 | Christos Stathis | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
|
21 | 63366925 | Christos Stathis | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
22 | 63366925 | Christos Stathis | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
23 | 63366925 | Christos Stathis | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
|
24 | 63366925 | Christos Stathis | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
25 | 63366925 | Christos Stathis | * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
26 | 63366925 | Christos Stathis | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
27 | 63366925 | Christos Stathis | * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
28 | 63366925 | Christos Stathis | * POSSIBILITY OF SUCH DAMAGE.
|
29 | 63366925 | Christos Stathis | *
|
30 | 63366925 | Christos Stathis | * The views and conclusions contained in the software and
|
31 | 63366925 | Christos Stathis | * documentation are those of the authors and should not be
|
32 | 63366925 | Christos Stathis | * interpreted as representing official policies, either expressed
|
33 | 63366925 | Christos Stathis | * or implied, of GRNET S.A.
|
34 | a57faaf0 | Christos Stathis | */
|
35 | a57faaf0 | Christos Stathis | package gr.grnet.pithos.web.client; |
36 | a57faaf0 | Christos Stathis | |
37 | a57faaf0 | Christos Stathis | import com.google.gwt.resources.client.ImageResource; |
38 | 4ac4833e | Christos Stathis | import com.google.gwt.user.client.Command; |
39 | 322213fd | Christos Stathis | import com.google.gwt.user.client.Window; |
40 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.AbstractImagePrototype; |
41 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.Composite; |
42 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.HTML; |
43 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
44 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.HasVerticalAlignment; |
45 | a57faaf0 | Christos Stathis | import com.google.gwt.user.client.ui.HorizontalPanel; |
46 | bbdd34ef | Christos Stathis | import com.google.gwt.user.client.ui.MenuBar; |
47 | bbdd34ef | Christos Stathis | import com.google.gwt.user.client.ui.MenuItem; |
48 | a57faaf0 | Christos Stathis | |
49 | a57faaf0 | Christos Stathis | /**
|
50 | a57faaf0 | Christos Stathis | * The top panel, which contains the menu bar icons and the user name.
|
51 | a57faaf0 | Christos Stathis | */
|
52 | a57faaf0 | Christos Stathis | public class TopPanel extends Composite { |
53 | a57faaf0 | Christos Stathis | |
54 | a57faaf0 | Christos Stathis | /**
|
55 | a57faaf0 | Christos Stathis | * A constant that denotes the completion of an IncrementalCommand.
|
56 | a57faaf0 | Christos Stathis | */
|
57 | a57faaf0 | Christos Stathis | public static final boolean DONE = false; |
58 | a57faaf0 | Christos Stathis | |
59 | 4ac4833e | Christos Stathis | Pithos app; |
60 | a7c43f26 | Christos Stathis | |
61 | a57faaf0 | Christos Stathis | /**
|
62 | a57faaf0 | Christos Stathis | * An image bundle for this widgets images.
|
63 | a57faaf0 | Christos Stathis | */
|
64 | 9326b841 | Christos Stathis | public interface Images extends FilePermissionsDialog.Images { |
65 | a57faaf0 | Christos Stathis | |
66 | f6445935 | Christos Stathis | @Source("gr/grnet/pithos/resources/pithos2-logo.png") |
67 | f6445935 | Christos Stathis | ImageResource pithosLogo(); |
68 | 76a8de3c | Christos Stathis | |
69 | 76a8de3c | Christos Stathis | @Source("gr/grnet/pithos/resources/desc.png") |
70 | 76a8de3c | Christos Stathis | ImageResource downArrow(); |
71 | a57faaf0 | Christos Stathis | } |
72 | a57faaf0 | Christos Stathis | |
73 | a57faaf0 | Christos Stathis | /**
|
74 | a57faaf0 | Christos Stathis | * The constructor for the top panel.
|
75 | a57faaf0 | Christos Stathis | *
|
76 | a57faaf0 | Christos Stathis | * @param images the supplied images
|
77 | a57faaf0 | Christos Stathis | */
|
78 | a7c43f26 | Christos Stathis | public TopPanel(Pithos _app, final Images images) { |
79 | a7c43f26 | Christos Stathis | this.app = _app;
|
80 | a57faaf0 | Christos Stathis | HorizontalPanel outer = new HorizontalPanel();
|
81 | a57faaf0 | Christos Stathis | outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT); |
82 | a57faaf0 | Christos Stathis | |
83 | a57faaf0 | Christos Stathis | outer.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE); |
84 | bbdd34ef | Christos Stathis | outer.setStyleName("pithos-topPanel");
|
85 | a57faaf0 | Christos Stathis | |
86 | 9578b580 | Christos Stathis | HorizontalPanel inner = new HorizontalPanel();
|
87 | 9578b580 | Christos Stathis | inner.setWidth("75%");
|
88 | 9578b580 | Christos Stathis | inner.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); |
89 | 9578b580 | Christos Stathis | |
90 | fb3c97f8 | Christos Stathis | HTML logos = new HTML("<table><tr><td><a href='/'>" + AbstractImagePrototype.create(images.pithosLogo()).getHTML() + "</a></td></tr></table>"); |
91 | a7b6e464 | Christos Stathis | logos.addStyleName("pithos-logo");
|
92 | 9578b580 | Christos Stathis | inner.add(logos); |
93 | 9578b580 | Christos Stathis | outer.add(inner); |
94 | 9578b580 | Christos Stathis | outer.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER); |
95 | 9578b580 | Christos Stathis | outer.setCellVerticalAlignment(inner, HasVerticalAlignment.ALIGN_BOTTOM); |
96 | a57faaf0 | Christos Stathis | initWidget(outer); |
97 | a57faaf0 | Christos Stathis | } |
98 | a57faaf0 | Christos Stathis | } |