Difference between revisions of "ToolBarButtonExtension"

From OpenKM Documentation
Jump to: navigation, search
(Created page with '== Methods == setLang(String code) langRefresh() checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) checkPermissions(GWTDocument doc, GWTFolder folde…')
 
Line 1: Line 1:
 
== Methods ==
 
== Methods ==
setLang(String code)
 
langRefresh()
 
 
  checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel)
 
  checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel)
 
  checkPermissions(GWTDocument doc, GWTFolder folder)
 
  checkPermissions(GWTDocument doc, GWTFolder folder)
Line 7: Line 5:
 
  boolean isEnabled()
 
  boolean isEnabled()
 
  enable(boolean enable)
 
  enable(boolean enable)
 
== setLang(String code) ==
 
Executed each time user interface language is changed. It's executed always before any langRefresh.
 
 
 
== langRefresh ==
 
Executed each time user interface is changed language
 
  
  
Line 42: Line 33:
 
public ToolBarButton(Image image, String title, ClickHandler handler) {
 
public ToolBarButton(Image image, String title, ClickHandler handler) {
 
super(image, title, handler);
 
super(image, title, handler);
}
 
 
@Override
 
public void langRefresh() {
 
if (lang.equals("en-GB")) {
 
title = "title";
 
} else {
 
title = "other title";
 
}
 
}
 
 
@Override
 
public void setLang(String code) {
 
lang = code;
 
 
}
 
}
  

Revision as of 12:46, 3 June 2010

Methods

checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel)
checkPermissions(GWTDocument doc, GWTFolder folder)
checkPermissions(GWTMail mail, GWTFolder folder)
boolean isEnabled()
enable(boolean enable)


checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel)

Check button permisions depending on folder grants in order to evaluate enable or disabling button


checkPermissions(GWTDocument doc, GWTFolder folder)

Check button permisions depending on document grants in order to evaluate enable or disabling button


checkPermissions(GWTMail mail, GWTFolder folder)

Check button permisions depending on mail grants in order to evaluate enable or disabling button


isEnabled()

Return boolena value indicating if button is enabled or disabled


enable(boolean enable)

Enables or disables button


Example

public class ToolBarButton extends ToolBarButtonExtension {
		
		public ToolBarButton(Image image, String title, ClickHandler handler) {
			super(image, title, handler);
		}

		@Override
		public void checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void checkPermissions(GWTDocument doc, GWTFolder folder) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void checkPermissions(GWTMail mail, GWTFolder folder) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public void enable(boolean enable) {
			// TODO Auto-generated method stub
			
		}

		@Override
		public boolean isEnabled() {
			// TODO Auto-generated method stub
			return false;
		}

	}