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…')
 
 
(12 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
== Methods ==
 
== Methods ==
setLang(String code)
+
=== checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) ===
langRefresh()
 
checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel)
 
checkPermissions(GWTDocument doc, GWTFolder folder)
 
checkPermissions(GWTMail mail, GWTFolder folder)
 
boolean isEnabled()
 
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
 
 
 
 
 
== checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) ==
 
 
Check button permisions depending on folder grants in order to evaluate enable or disabling button
 
Check button permisions depending on folder grants in order to evaluate enable or disabling button
  
 
+
=== checkPermissions(GWTDocument doc, GWTFolder folder) ===
== checkPermissions(GWTDocument doc, GWTFolder folder) ==
 
 
Check button permisions depending on document grants in order to evaluate enable or disabling button
 
Check button permisions depending on document grants in order to evaluate enable or disabling button
  
 
+
=== checkPermissions(GWTMail mail, GWTFolder folder) ===
== checkPermissions(GWTMail mail, GWTFolder folder) ==
 
 
Check button permisions depending on mail grants in order to evaluate enable or disabling button
 
Check button permisions depending on mail grants in order to evaluate enable or disabling button
  
 +
===  isEnabled() ===
 +
Return boolean value indicating if button is enabled or disabled
  
==  isEnabled() ==
+
=== enable(boolean enable) ===
Return boolena value indicating if button is enabled or disabled
 
 
 
 
 
== enable(boolean enable) ==
 
 
Enables or disables button
 
Enables or disables button
  
 +
=== getExtensionUUID() ===
 +
Return unique extension id
  
 
== Example ==
 
== Example ==
Line 40: Line 22:
 
public class ToolBarButton extends ToolBarButtonExtension {
 
public class ToolBarButton extends ToolBarButtonExtension {
 
 
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
+
@Override
public void langRefresh() {
+
public void checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) {
if (lang.equals("en-GB")) {
+
// TODO Auto-generated method stub
title = "title";
+
}
} else {
 
title = "other title";
 
}
 
}
 
  
@Override
+
@Override
public void setLang(String code) {
+
public void checkPermissions(GWTDocument doc, GWTFolder folder) {
lang = code;
+
// TODO Auto-generated method stub
}
+
}
  
@Override
+
@Override
public void checkPermissions(GWTFolder folder, GWTFolder folderParent, int originPanel) {
+
public void checkPermissions(GWTMail mail, GWTFolder folder) {
// TODO Auto-generated method stub
+
// TODO Auto-generated method stub
+
}
}
 
  
@Override
+
@Override
public void checkPermissions(GWTDocument doc, GWTFolder folder) {
+
public void enable(boolean enable) {
// TODO Auto-generated method stub
+
// TODO Auto-generated method stub
+
}
}
 
  
@Override
+
@Override
public void checkPermissions(GWTMail mail, GWTFolder folder) {
+
public boolean isEnabled() {
// TODO Auto-generated method stub
+
// TODO Auto-generated method stub
+
return false;
}
+
}
 
 
@Override
 
public void enable(boolean enable) {
 
// TODO Auto-generated method stub
 
 
}
 
 
 
@Override
 
public boolean isEnabled() {
 
// TODO Auto-generated method stub
 
return false;
 
}
 
  
 +
@Override
 +
public String getExtensionUUID() {
 +
return "9f84b330-d096-11df-bd3b-0800200c9a66";
 
}
 
}
 +
}
 
</source>
 
</source>
  
[[Category: OpenKM plugin extensions]]
+
[[Category: Extension Guide]]

Latest revision as of 18:43, 7 July 2012

Methods

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 boolean value indicating if button is enabled or disabled

enable(boolean enable)

Enables or disables button

getExtensionUUID()

Return unique extension id

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;
	}

	@Override
	public String getExtensionUUID() {
		return "9f84b330-d096-11df-bd3b-0800200c9a66";
	}
}