Revision 64800147
b/src/gr/grnet/pithos/web/client/Pithos.java | ||
---|---|---|
78 | 78 |
* Entry point classes define <code>onModuleLoad()</code>. |
79 | 79 |
*/ |
80 | 80 |
public class Pithos implements EntryPoint, ResizeHandler { |
81 |
private static final boolean IsLOGEnabled = true;
|
|
81 |
private static final boolean IsLOGEnabled = false;
|
|
82 | 82 |
public static final boolean IsDetailedHTTPLOGEnabled = true; |
83 | 83 |
public static final boolean IsFullResponseBodyLOGEnabled = true; |
84 | 84 |
|
... | ... | |
343 | 343 |
} |
344 | 344 |
|
345 | 345 |
static native void __ConsoleLog(String message) /*-{ |
346 |
try { |
|
347 |
console.log(message); |
|
348 |
} catch (e) { |
|
349 |
} |
|
346 |
try { console.log(message); } catch (e) {} |
|
350 | 347 |
}-*/; |
351 | 348 |
|
352 | 349 |
public static void LOGError(Throwable error, StringBuilder sb) { |
353 |
if(!IsLOGEnabled) { return; }
|
|
350 |
if(!isLOGEnabled()) { return; }
|
|
354 | 351 |
|
355 | 352 |
sb.append("\nException: [" + error.toString().replace("\n", "\n ") + "]"); |
356 | 353 |
Throwable cause = error.getCause(); |
... | ... | |
378 | 375 |
} |
379 | 376 |
|
380 | 377 |
public static void LOGError(Throwable error) { |
381 |
if(!IsLOGEnabled) { return; }
|
|
378 |
if(!isLOGEnabled()) { return; }
|
|
382 | 379 |
|
383 | 380 |
final StringBuilder sb = new StringBuilder(); |
384 | 381 |
LOGError(error, sb); |
... | ... | |
387 | 384 |
} |
388 | 385 |
} |
389 | 386 |
|
390 |
public static boolean isLogEnabled() {
|
|
387 |
public static boolean isLOGEnabled() {
|
|
391 | 388 |
return IsLOGEnabled; |
392 | 389 |
} |
393 | 390 |
|
394 | 391 |
public static void LOG(Object ...args) { |
395 |
if(!IsLOGEnabled) { return; }
|
|
392 |
if(!isLOGEnabled()) { return; }
|
|
396 | 393 |
|
397 | 394 |
final StringBuilder sb = new StringBuilder(); |
398 | 395 |
for(Object arg : args) { |
b/src/gr/grnet/pithos/web/client/StatusPanel.java | ||
---|---|---|
42 | 42 |
*/ |
43 | 43 |
public class StatusPanel extends Composite { |
44 | 44 |
|
45 |
/** |
|
46 |
* The constructor of the status panel. |
|
47 |
*/ |
|
48 |
public StatusPanel() { |
|
49 |
Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); |
|
50 |
final String SERVICE_NAME = otherProperties.get("SERVICE_NAME"); |
|
51 |
final String SERVICE_URL = otherProperties.get("SERVICE_URL"); |
|
52 |
final String COMPANY_NAME = otherProperties.get("COMPANY_NAME"); |
|
45 |
/** |
|
46 |
* The constructor of the status panel. |
|
47 |
*/ |
|
48 |
public StatusPanel() { |
|
49 |
Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); |
|
53 | 50 |
final String COMPANY_URL = otherProperties.get("COMPANY_URL"); |
54 | 51 |
final String COPYRIGHT_MESSAGE = otherProperties.get("COPYRIGHT_MESSAGE"); |
55 | 52 |
final String SYNNEFO_VERSION = otherProperties.get("SYNNEFO_VERSION"); |
56 | 53 |
|
57 |
HorizontalPanel outer = new HorizontalPanel();
|
|
58 |
outer.setWidth("100%");
|
|
59 |
outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
|
54 |
HorizontalPanel outer = new HorizontalPanel();
|
|
55 |
outer.setWidth("100%");
|
|
56 |
outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
|
|
60 | 57 |
|
61 | 58 |
VerticalPanel inner = new VerticalPanel(); |
62 | 59 |
inner.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER); |
63 |
HorizontalPanel firstLine = new HorizontalPanel();
|
|
64 |
firstLine.setSpacing(8);
|
|
60 |
HorizontalPanel firstLine = new HorizontalPanel();
|
|
61 |
firstLine.setSpacing(8);
|
|
65 | 62 |
firstLine.add(new HTML("<a class='grnet-sign' href='" + COMPANY_URL + "'>" + COPYRIGHT_MESSAGE + "</a>")); |
66 |
inner.add(firstLine);
|
|
63 |
inner.add(firstLine);
|
|
67 | 64 |
|
68 | 65 |
HorizontalPanel secondLine = new HorizontalPanel(); |
69 | 66 |
secondLine.add(new HTML( |
70 |
"<div class='software'>Powered by <a href='http://synnefo.org'>Synnefo</a> <span class='version'>v " + SYNNEFO_VERSION + "</span></div>")); |
|
71 |
secondLine.addStyleName("software"); |
|
67 |
"<div class='software'>" + |
|
68 |
"Powered by <a href='http://synnefo.org'>synnefo</a>" + |
|
69 |
"<span class='version'> v " + SYNNEFO_VERSION + "</span>" + |
|
70 |
"</div>")); |
|
71 |
// secondLine.addStyleName("software"); |
|
72 | 72 |
inner.add(secondLine); |
73 | 73 |
outer.add(inner); |
74 | 74 |
outer.addStyleName("pithos-statusbar"); |
75 | 75 |
|
76 |
initWidget(outer);
|
|
77 |
}
|
|
76 |
initWidget(outer);
|
|
77 |
}
|
|
78 | 78 |
} |
b/src/gr/grnet/pithos/web/client/TopPanel.java | ||
---|---|---|
34 | 34 |
*/ |
35 | 35 |
package gr.grnet.pithos.web.client; |
36 | 36 |
|
37 |
import com.google.gwt.i18n.client.Dictionary; |
|
37 | 38 |
import com.google.gwt.resources.client.ImageResource; |
38 |
import com.google.gwt.user.client.Command; |
|
39 |
import com.google.gwt.user.client.Window; |
|
40 |
import com.google.gwt.user.client.ui.AbstractImagePrototype; |
|
41 |
import com.google.gwt.user.client.ui.Composite; |
|
42 |
import com.google.gwt.user.client.ui.HTML; |
|
43 |
import com.google.gwt.user.client.ui.HasHorizontalAlignment; |
|
44 |
import com.google.gwt.user.client.ui.HasVerticalAlignment; |
|
45 |
import com.google.gwt.user.client.ui.HorizontalPanel; |
|
46 |
import com.google.gwt.user.client.ui.MenuBar; |
|
47 |
import com.google.gwt.user.client.ui.MenuItem; |
|
39 |
import com.google.gwt.user.client.ui.*; |
|
48 | 40 |
|
49 | 41 |
/** |
50 | 42 |
* The top panel, which contains the menu bar icons and the user name. |
51 | 43 |
*/ |
52 | 44 |
public class TopPanel extends Composite { |
53 | 45 |
|
54 |
/**
|
|
55 |
* A constant that denotes the completion of an IncrementalCommand.
|
|
56 |
*/
|
|
57 |
public static final boolean DONE = false;
|
|
46 |
/**
|
|
47 |
* A constant that denotes the completion of an IncrementalCommand.
|
|
48 |
*/
|
|
49 |
public static final boolean DONE = false;
|
|
58 | 50 |
|
59 | 51 |
Pithos app; |
60 | 52 |
|
61 |
/** |
|
62 |
* An image bundle for this widgets images. |
|
63 |
*/ |
|
64 |
public interface Images extends FilePermissionsDialog.Images { |
|
53 |
/** |
|
54 |
* An image bundle for this widgets images. |
|
55 |
*/ |
|
56 |
public interface Images extends FilePermissionsDialog.Images { |
|
57 |
@Source("gr/grnet/pithos/resources/pithos2-logo.png") |
|
58 |
ImageResource pithosLogo(); |
|
65 | 59 |
|
66 |
@Source("gr/grnet/pithos/resources/pithos2-logo.png") |
|
67 |
ImageResource pithosLogo(); |
|
68 |
|
|
69 |
@Source("gr/grnet/pithos/resources/desc.png") |
|
70 |
ImageResource downArrow(); |
|
71 |
} |
|
60 |
@Source("gr/grnet/pithos/resources/desc.png") |
|
61 |
ImageResource downArrow(); |
|
62 |
} |
|
72 | 63 |
|
73 |
/**
|
|
74 |
* The constructor for the top panel.
|
|
75 |
*
|
|
76 |
* @param images the supplied images
|
|
77 |
*/
|
|
78 |
public TopPanel(Pithos _app, final Images images) {
|
|
64 |
/**
|
|
65 |
* The constructor for the top panel.
|
|
66 |
*
|
|
67 |
* @param images the supplied images
|
|
68 |
*/
|
|
69 |
public TopPanel(Pithos _app, final Images images) {
|
|
79 | 70 |
this.app = _app; |
80 |
HorizontalPanel outer = new HorizontalPanel();
|
|
81 |
outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
|
|
71 |
HorizontalPanel outer = new HorizontalPanel();
|
|
72 |
outer.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
|
|
82 | 73 |
|
83 |
outer.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
|
|
84 |
outer.setStyleName("pithos-topPanel");
|
|
74 |
outer.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
|
|
75 |
outer.setStyleName("pithos-topPanel");
|
|
85 | 76 |
|
86 |
HorizontalPanel inner = new HorizontalPanel(); |
|
87 |
inner.setWidth("75%"); |
|
88 |
inner.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); |
|
89 |
|
|
90 |
HTML logos = new HTML("<table><tr><td><a href='/'>" + AbstractImagePrototype.create(images.pithosLogo()).getHTML() + "</a></td></tr></table>"); |
|
91 |
logos.addStyleName("pithos-logo"); |
|
92 |
inner.add(logos); |
|
77 |
HorizontalPanel inner = new HorizontalPanel(); |
|
78 |
inner.setWidth("75%"); |
|
79 |
inner.setVerticalAlignment(HasVerticalAlignment.ALIGN_BOTTOM); |
|
80 |
|
|
81 |
Dictionary otherProperties = Dictionary.getDictionary("otherProperties"); |
|
82 |
final String STORAGE_LOGO_URL = otherProperties.get("STORAGE_LOGO_URL"); |
|
83 |
final Image logo = new Image(STORAGE_LOGO_URL); |
|
84 |
Pithos.LOG("Pithos Logo = ", logo.getUrl()); |
|
85 |
inner.add(logo); |
|
93 | 86 |
outer.add(inner); |
94 | 87 |
outer.setCellHorizontalAlignment(inner, HasHorizontalAlignment.ALIGN_CENTER); |
95 | 88 |
outer.setCellVerticalAlignment(inner, HasVerticalAlignment.ALIGN_BOTTOM); |
96 |
initWidget(outer);
|
|
97 |
}
|
|
89 |
initWidget(outer);
|
|
90 |
}
|
|
98 | 91 |
} |
Also available in: Unified diff