input
stringlengths
10
828
output
stringlengths
5
107
public void set name string name this name name
sets the name of the cache
public cache event notification service get cache event notification service return cache event notification service
use this to access the service in order to register and unregister listeners
public void set max elements in memory int max elements in memory this max elements in memory max elements in memory
sets the maximum objects to be held in memory
public void notify element removed element element iterator iterator cache event listeners iterator while iterator has next cache event listener cache event listener cache event listener iterator next cache event listener notify element removed cache element
notifies all registered listeners in no guaranteed order that an element was removed
public void set memory store eviction policy string memory store eviction policy this memory store eviction policy memory store eviction policy from string memory store eviction policy
sets the eviction policy
public void notify element expiry element element iterator iterator cache event listeners iterator while iterator has next cache event listener cache event listener cache event listener iterator next cache event listener notify element expired cache element
notifies all registered listeners in no guaranteed order that an element has expired
public boolean register listener cache event listener cache event listener return cache event listeners add cache event listener
adds a listener to the notification service
public boolean unregister listener cache event listener cache event listener return cache event listeners remove cache event listener
removes a listener from the notification service
public set get cache event listeners return cache event listeners
gets a list of the listeners registered to this class
public void set eternal boolean eternal this eternal eternal
sets whether elements are eternal
public void send notification cluster notification message if log is debug enabled log debug send notification message bus send notification message
uses java groups to broadcast the supplied notification message across the
public void set time to idle seconds int time to idle seconds this time to idle seconds time to idle seconds
sets the time to idle for an element before it expires
public serializable get cache return broadcasting manager bus get local address
we are not using the caching so we just return something that identifies
public void member joined address address if log is info enabled log info a new member at address address has joined the cluster
a callback that is fired when a new member joins the cluster
public void member left address address if log is info enabled log info member at address address left the cluster
a callback that is fired when an existing member leaves the cluster
public void set time to live seconds int time to live seconds this time to live seconds time to live seconds
sets the time to idle for an element before it expires
public void shutdown if status equals status status shutdown if log is warn enabled log warn cache manager already shutdown return synchronized cache manager class all cache managers disk store paths remove disk store path enumeration all caches caches elements while all caches has more elements cache cache cache all caches next element if cache null cache dispose if get broadcasting manager null get broadcasting manager stop status status status shutdown only delete singleton if the singleton is shutting down if this singleton singleton null
shuts down the cache manager
public void set overflow to disk boolean overflow to disk this overflow to disk overflow to disk
sets whether elements can overflow to disk when the in memory cache
public void set disk persistent boolean disk persistent this disk persistent disk persistent
sets whether for caches that overflow to disk
public void set disk expiry thread interval seconds int disk expiry thread interval seconds this disk expiry thread interval seconds disk expiry thread interval seconds
sets the interval in seconds between runs of the disk expiry thread
public void start bundle context context throws exception super start context
this method is called upon plug in activation
public void stop bundle context context throws exception super stop context plugin null
this method is called when the plug in is stopped
protected void give focus to projects names projects names combo set focus
set the current input focus to selfs destination entry field
protected string handle directory browse string path directory dialog directory dialog new directory dialog get shell if path null equals path directory dialog set filter path path string dir name directory dialog open return dir name
uses the standard container selection file dialog to choose the new value
public serializable save object obj throws hibernate exception if obj null throw new null pointer exception attempted to save null object object unproxy obj throws exception if uninitialized entity entry e get entry object if e null if e status deleted force flush e else log trace object already associated with session return e id serializable id save with generated identifier object cascades action save update null id might be generated by sql insert reassociate proxy obj id todo move into save with generated identifier return id
save a transient object
private void reassociate proxy lazy initializer li hibernate proxy proxy throws mapping exception if li get session this class persister persister get class persister li get persistent class key key new key li get identifier persister if proxies by key contains key key proxies by key put key proxy any earlier proxy takes precedence hibernate proxy helper get lazy initializer proxy set session this
associate a proxy that was instantiated by another session with this session
public list find string query throws hibernate exception return find query no args no types
retrieve a list of persistent objects using a hibernate query
public void run iaction action update manager dialog d new update manager dialog platform ui get workbench get active workbench window get shell d open
the action has been activated
public void selection changed iaction action iselection selection
selection in the workbench has been changed
public void dispose
we can use this method to dispose of any system
public void init iworkbench window window this window window
we will cache window object in order to
protected boolean allow new container name return false
the code add to hierarchy to checked store code implementation of this
public void about to open determine white checked descendents root check new tree elements tree content provider get elements root select the first element in the list object elements tree content provider get elements root object primary elements length 0 elements 0 null if primary null tree viewer set selection new structured selection primary tree viewer get control set focus
this method must be called just before this window becomes visible
public void add check state listener icheck state listener listener add listener object listener
add the passed listener to selfs collection of clients
private itree content provider get resource provider final int resource type return new workbench content provider suppress warnings unchecked public object get children object o input element case if o instanceof array list return array list o to array return new object 0
returns a content provider for code iresource code s that returns
protected boolean are all children white checked object tree element object children tree content provider get children tree element for int i 0 i children length i if white checked tree items contains children i return false return true
return a boolean indicating whether all children of the passed tree element
protected boolean are all elements checked object tree element list checked elements list checked state store get tree element if checked elements null return false return true
return a boolean indicating whether all list elements associated with
protected void check new tree elements object elements for int i 0 i elements length i object current element elements i boolean checked checked state store contains key current element tree viewer set checked current element checked tree viewer set grayed current element checked white checked tree items contains current element
iterate through the passed elements which are being realized for the first
protected iterator get selected resources iterator return this resource group get all checked list items iterator
returns this pages collection of currently specified resources to be
public void check state changed final check state changed event event potentially long operation show a busy cursor busy indicator show while tree viewer get control get display new runnable public void run if event get checkable equals tree viewer tree item checked event get element event get checked notify check state change listeners event
an item was checked in one of selfs two views
protected list get types to export return selected types
returns the resource extensions currently specified to be exported
protected list get white checked resources return this resource group get all white checked items
returns this pages collection of currently specified resources to be
protected void create tree viewer composite parent boolean use height hint tree tree new tree parent swt check swt border grid data data new grid data grid data fill both if use height hint data height hint preferred height tree set layout data data tree set font parent get font tree viewer new checkbox tree viewer tree tree viewer set content provider tree content provider tree viewer set label provider tree label provider tree viewer add tree listener this tree viewer add check state listener this tree viewer add selection changed listener this
create this groups tree viewer
protected boolean has exportable extension string resource name if selected types null return true int separator index resource name last index of non nls 1 if separator index 1 return false string extension resource name substring separator index 1 iterator it selected types iterator while it has next if extension equals ignore case string it next return true return false
returns whether the extension of the given resource name is an extension that
protected boolean determine should be white checked object tree element return are all children white checked tree element are all elements checked tree element
returns a boolean indicating whether the passed tree item should be
protected void determine white checked descendents object tree element always go through all children first since their white checked statuses will be needed to determine the white checked status for this tree element object children tree content provider get elements tree element for int i 0 i children length i determine white checked descendents children i now determine the white checked status for this tree element if determine should be white checked tree element set white checked tree element true
recursively add appropriate tree elements to the collection of
protected void save widget values allow subclasses to save values internal save widget values
persists resource specification control setting that are to be restored
public void expand all tree viewer expand all
cause the tree viewer to expand all its items
protected void setup based on initial selections iterator it this initial resource selection iterator while it has next iresource current resource iresource it next if current resource get type iresource file this resource group initial check tree item current resource
set the initial selections in the resource group
protected boolean save dirty editors return ideworkbench plugin get default get workbench save all editors true
save any editors that the user wants to save before export
public list get all checked list items final array list return value new array list ielement filter pass through filter new ielement filter suppress warnings unchecked public void filter elements collection elements iprogress monitor monitor return value add all elements suppress warnings unchecked public void filter elements object elements iprogress monitor monitor for int i 0 i elements length i return value add elements i try get all checked list items pass through filter null catch interrupted exception exception return new array list return return value
returns a flat list of all of the leaf elements which are checked
protected void update widget enablements boolean page complete determine page completion set page complete page complete if page complete set message null super update widget enablements
check if widgets are enabled or disabled by a change in the dialog
public object instantiate class persister persister serializable id throws hibernate exception object result interceptor instantiate persister get mapped class id if result null result persister instantiate id return result
give the interceptor an opportunity to override the default instantiation
protected void add destination item string value destination name field add value
add the passed value to selfs destination widgets history
public list get all white checked items list result new array list iterate through the children of the root as the root is not in the store object children tree content provider get children root for int i 0 i children length i find all white checked items children i result return result
returns a list of all of the items that are white checked
public int get checked element count return checked state store size
answer the number of elements that have been checked by the
protected void create directory structure options composite options group font font create directory structure radios create directory structure button new button options group swt radio swt left create directory structure button set text data transfer messages file export create directory structure create directory structure button set selection false create directory structure button set font font create directory structure radios create selection only button new button options group swt radio swt left create selection only button set text data transfer messages file export create selected directories create selection only button set selection true create selection only button set font font
create the buttons for the group that determine if the entire or
private void gray update hierarchy object tree element boolean should be at least gray determine should be at least gray checked tree element tree viewer set gray checked tree element should be at least gray if white checked tree items contains tree element white checked tree items remove tree element proceed up the tree element hierarchy object parent tree content provider get parent tree element if parent null gray update hierarchy parent
set the checked state of self and all ancestors appropriately
public void initial check tree item object element tree item checked element true select and reveal element
set the initial checked state of the passed element to true
protected boolean ensure directory exists file directory if directory exists if query yes no question data transfer messages data transfer create target directory return false if directory mkdirs display error dialog data transfer messages data transfer directory creation error give focus to destination return false return true
attempts to ensure that the specified directory exists on the local file system
protected boolean ensure target is valid file target directory if target directory exists target directory is directory display error dialog data transfer messages file export directory exists give focus to destination return false return ensure directory exists target directory
if the target for export does not exist then attempt to create it
protected boolean execute export operation file system export operation op op set create leadup structure create directory structure button get selection op set overwrite files overwrite existing files checkbox get selection try get container run true true op catch interrupted exception e return false catch invocation target exception e display error dialog e get target exception return false istatus status op get status if status is ok error dialog open error get container get shell data transfer messages data transfer export problems null no special message status return false return true
set up and execute the passed operation
protected string get destination label return data transfer messages file export to directory
answer the string to display in self as the destination type
public void remove check state listener icheck state listener listener remove listener object listener
remove the passed listener from selfs collection of clients
protected string get destination value return destination name field get text trim
answer the contents of selfs destination specification widget
protected void give focus to destination destination name field set focus
set the current input focus to selfs destination entry field
protected void handle destination browse button pressed directory dialog dialog new directory dialog get container get shell swt save dialog set message select destination message dialog set text select destination title dialog set filter path get destination value string selected directory name dialog open if selected directory name null set error message null set destination value selected directory name
open an appropriate destination browser so that the user can specify a source
public void set root object new root this root new root initialize
set the root of the widget to be new root
public void handle event event e widget source e widget if source destination browse button handle destination browse button pressed update page completion
handle all events and enablements for widgets in this page
protected void set tree checked object tree element boolean state if state checked state store remove tree element set white checked tree element state tree viewer set checked tree element state tree viewer set grayed tree element false now logically check uncheck all children as well if it has been expanded if expanded tree nodes contains tree element object children tree content provider get children tree element for int i 0 i children length i set tree checked children i state
set the checked state of the passed tree element appropriately and
private void internal save widget values update directory names history idialog settings settings get dialog settings if settings null string directory names settings get array store destination names id if directory names null directory names new string 0 directory names add to history directory names get destination value settings put store destination names id directory names options settings put store overwrite existing files id overwrite existing files checkbox get selection settings put store create structure id create directory structure button get selection
persists additional setting that are to be restored in the next instance of
public object narrow proxy object proxy class persister persister key key object object throws hibernate exception if persister get concrete proxy class is assignable from proxy get class if log is warn enabled log warn narrowing proxy to persister get concrete proxy class this operation breaks if object null proxies by key remove key return object return the proxied object else proxy persister create proxy key get identifier this proxies by key put key proxy overwrite old proxy return proxy else return proxy
if the existing proxy is insufficiently narrow derived instantiate a new proxy
public void set tree sorter viewer sorter sorter tree viewer set sorter sorter
set the sorter that is to be applied to selfs tree viewer
protected void restore widget values idialog settings settings get dialog settings if settings null string directory names settings get array store destination names id if directory names null return ie no settings stored destination set destination value directory names 0 for int i 0 i directory names length i add destination item directory names i options overwrite existing files checkbox set selection settings get boolean store overwrite existing files id boolean create directories settings get boolean store create structure id create directory structure button set selection create directories create selection only button set selection create directories
hook method for restoring widget values to the values that they held
public void tree collapsed tree expansion event event we don t need to do anything with this
handle the collapsing of an element in a tree viewer
protected void set destination value string value destination name field set text value
set the contents of the receivers destination specification widget to
public void tree expanded tree expansion event event expand tree element event get element
handle the expansionsion of an element in a tree viewer
protected boolean validate destination group string destination value get destination value if destination value length 0 set message destination empty message return false string conflicting container get conflicting container name for destination value if conflicting container null set error message null else set error message nls bind data transfer messages file export conflicting container conflicting container give focus to destination return false return true
answer a boolean indicating whether the receivers destination specification
public object proxy for class persister persister key key object impl throws hibernate exception if persister has proxy return impl object proxy proxies by key get key if proxy null return narrow proxy proxy persister key impl else return impl
grab the existing proxy for an instance if
protected void tree item checked object tree element boolean state recursively adjust all child tree elements appropriately set tree checked tree element state object parent tree content provider get parent tree element if parent null return now update upwards in the tree hierarchy if state gray check hierarchy parent else ungray check hierarchy parent update the hierarchy but do not white select the parent gray update hierarchy parent
callback thats invoked when the checked status of an item in the tree
protected void ungray check hierarchy object tree element if determine should be at least gray checked tree element checked state store remove tree element object parent tree content provider get parent tree element if parent null ungray check hierarchy parent
logically un gray check all ancestors of tree item iff appropriate
protected void update hierarchy object tree element boolean white checked determine should be white checked tree element boolean should be at least gray determine should be at least gray checked tree element tree viewer set checked tree element should be at least gray set white checked tree element white checked if white checked tree viewer set grayed tree element false else tree viewer set grayed tree element should be at least gray proceed up the tree element hierarchy but gray select all of them object parent tree content provider get parent tree element if parent null gray update hierarchy parent
set the checked state of self and all ancestors appropriately
protected string destination empty message return data transfer messages file export destination empty
get the message used to denote an empty destination
protected string get conflicting container name for string target directory iworkspace root root resources plugin get workspace get root ipath test path new path target directory if root get location is prefix of test path return data transfer messages file export root name icontainer containers root find containers for location test path if containers length 0 return containers 0 get name return null
returns the name of a container with a location that encompasses target directory
public void set focus this tree viewer get tree set focus
set the focus on to the list widget
protected int count selected resources throws core exception int result 0 iterator resources resources to export iterator while resources has next result count children of iresource resources next return result
answer a boolean indicating the number of file resources that were
protected void create leadup directories for iresource child resource ipath resource path child resource get full path remove last segments 1 make path tree resource path
create the directories required for exporting the passed resource
protected void create leadup directories for ipath child path ipath resource path child path remove last segments 1 make path tree resource path
create the directories required for exporting the passed resource
private void make path tree ipath tree ipath target path tree remove last segments tree segment count 1 for int i 1 i tree segment count i target path target path append tree segment i if target path to file exists target path to file mkdir
create the directories tree
public void add uninitialized entity key key object object lock mode lock mode add entity key object add entry object loading null key get identifier null lock mode true null get persister object false temporary
create a temporary entry for a newly instantiated entity
protected boolean is descendent list resources iresource child if child get type iresource project return false iresource parent child get parent if resources contains parent return true return is descendent resources parent
answer a boolean indicating whether the passed child is a descendent
public void set create container directories boolean value create container directories value
set this boolean indicating whether a directory should be created for
public void set create leadup structure boolean value create leadup structure value
set this boolean indicating whether each exported resources complete path should
public void set overwrite files boolean value if value overwrite state overwrite all
set this boolean indicating whether exported resources should automatically
public void post hydrate class persister persister serializable id object values object object lock mode lock mode throws hibernate exception persister set identifier object id object version versioning get version values persister add entry object loading values id version lock mode true persister false if log is trace enabled version null log trace version version
add the hydrated state an array of an uninitialized entity to the session
private zip file get specified source file string file name if file name length 0 return null try return new zip file file name catch zip exception e add error data transfer messages zip import bad format e catch ioexception e add error data transfer messages zip import could not read e return null
answer a handle to the zip file currently specified as being the source
protected boolean close zip file zip file file try file close catch ioexception e add error nls bind data transfer messages zip import could not close file get name e return false return true
attempts to close the passed zip file and answers a boolean indicating success
private void initialize values final ipreference store store get preference store for iterator iter f fields iterator iter has next field iter next initialize value store
initializes states of the controls from the preference store
protected ipreference store do get preference store return cvsuiplugin get plugin get preference store
returns preference store that belongs to the our plugin
protected void create image descriptor string id url url file locator find cvsuiplugin get plugin get bundle new path icvsuiconstants icon path id null image descriptor desc image descriptor create from url url image descriptors put id desc
creates an image and places it in the image registry