From: Gurkan E. <gur...@ya...> - 2006-07-09 04:37:54
|
User: gurkanerdogdu Date: 06/07/09 00:37:50 Modified: cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages StandardConfigurationPage.java CacheLoaderTableProvider.java CacheLoaderConfigurationPage.java Log: New Cache Loader Custom Configuration added Revision Changes Path 1.6 +59 -11 jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/StandardConfigurationPage.java (In the diff below, changes in quantity of whitespace are not shown.) Index: StandardConfigurationPage.java =================================================================== RCS file: /cvsroot/jboss/jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/StandardConfigurationPage.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- StandardConfigurationPage.java 6 Jul 2006 19:48:56 -0000 1.5 +++ StandardConfigurationPage.java 9 Jul 2006 04:37:50 -0000 1.6 @@ -9,6 +9,7 @@ import java.io.File; import java.util.ArrayList; import java.util.Iterator; +import java.util.List; import org.eclipse.core.runtime.Path; import org.eclipse.jface.resource.ImageDescriptor; @@ -34,7 +35,10 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; import org.eclipse.swt.widgets.Widget; +import org.eclipse.ui.forms.widgets.Hyperlink; import org.jboss.ide.eclipse.jbosscache.ICacheConstants; +import org.jboss.ide.eclipse.jbosscache.JBossCachePlugin; +import org.jboss.ide.eclipse.jbosscache.dialogs.CacheLoaderDefDialog; import org.jboss.ide.eclipse.jbosscache.internal.CacheMessages; import org.jboss.ide.eclipse.jbosscache.model.config.CacheConfigParams; import org.jboss.ide.eclipse.jbosscache.utils.CacheUtil; @@ -66,6 +70,8 @@ private static final String DEFAULT_LOCK_ACK_TIMEOUT = "15000"; + private CacheLoaderDefDialog cacheLoaderDialog; + private Label lblCacheName; private Text txtCacheName; @@ -153,10 +159,12 @@ private ISelection selection; - //TODO : Eviction Policy Configuration must be added; - private Group grpConfGroup; + private List cacheLoaderCustomModel = new ArrayList(); + + private String cacheLoaderCustomClassName = ""; + // private Button btnClusterConfig; /*Show new wizard for cluster configuration*/ // private Button btnCacheLoaderClass;/*Show new wizard for cache loader configuration*/ @@ -194,6 +202,7 @@ GridData gridData = new GridData(GridData.FILL_HORIZONTAL); + Group filePath = new Group(container, SWT.SHADOW_ETCHED_IN); filePath.setText("File Location"); GridData gDataPath = new GridData(GridData.FILL_HORIZONTAL); @@ -230,6 +239,7 @@ txtConfFileName = new Text(filePath, SWT.BORDER); txtConfFileName.setText(DEFAULT_CACHE_XML_FILE_NAME); txtConfFileName.addModifyListener(this); + GridData gDataForConfText = new GridData(GridData.FILL_HORIZONTAL); gDataForConfText.horizontalSpan = 2; txtConfFileName.setLayoutData(gDataForConfText); @@ -360,14 +370,23 @@ cmbDefaultEvcitionPolicy = new Combo(grpConfGroup,SWT.DROP_DOWN); cmbDefaultEvcitionPolicy.setItems(ICacheConstants.EVICTION_POLICY_CLASSES); cmbDefaultEvcitionPolicy.select(0); - cmbDefaultEvcitionPolicy.setLayoutData(gridData); + cmbDefaultEvcitionPolicy.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + lblCacheLoaderClass = new Label(grpConfGroup, SWT.NONE); lblCacheLoaderClass.setText("Default Cache Loader :"); - cmbCacheLoaderClass = new Combo(grpConfGroup, SWT.DROP_DOWN); + + cmbCacheLoaderClass = new Combo(grpConfGroup, SWT.READ_ONLY); cmbCacheLoaderClass.setItems(ICacheConstants.CACHE_LOADER_CLASSES); cmbCacheLoaderClass.select(0); - cmbCacheLoaderClass.setLayoutData(gridData); + cmbCacheLoaderClass.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + cmbCacheLoaderClass.addSelectionListener(new SelectionAdapter(){ + + public void widgetSelected(SelectionEvent e){ + handleCustomCacheLoader(e); + } + }); + chkBuddyReplicationEnabled = new Button(grpConfGroup,SWT.CHECK); @@ -434,7 +453,16 @@ setControl(container); }//end of method - /** + private void handleCustomCacheLoader(SelectionEvent e) { + Combo combo = (Combo)e.widget; + + if(combo.getSelectionIndex() == 1){//Custom + cacheLoaderDialog = new CacheLoaderDefDialog(getShell(),"Custom Cache Loader Configuration",this); + cacheLoaderDialog.open(); + } + } + +/** * Jar selection */ private void handleAddJarSelected() @@ -784,4 +812,24 @@ this.chkBuddyReplicationEnabled = chkBuddyReplicationEnabled; } +public CacheLoaderDefDialog getCacheLoaderDialog() { + return cacheLoaderDialog; +} + +public List getCacheLoaderCustomModel() { + return cacheLoaderCustomModel; +} + +public void setCacheLoaderCustomModel(List cacheLoaderCustomModel) { + this.cacheLoaderCustomModel = cacheLoaderCustomModel; +} + +public String getCacheLoaderCustomClassName() { + return cacheLoaderCustomClassName; +} + +public void setCacheLoaderCustomClassName(String cacheLoaderCustomClassName) { + this.cacheLoaderCustomClassName = cacheLoaderCustomClassName; +} + }//end of class \ No newline at end of file 1.2 +2 -7 jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/CacheLoaderTableProvider.java (In the diff below, changes in quantity of whitespace are not shown.) Index: CacheLoaderTableProvider.java =================================================================== RCS file: /cvsroot/jboss/jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/CacheLoaderTableProvider.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- CacheLoaderTableProvider.java 6 Jul 2006 17:17:01 -0000 1.1 +++ CacheLoaderTableProvider.java 9 Jul 2006 04:37:50 -0000 1.2 @@ -1,6 +1,7 @@ package org.jboss.ide.eclipse.jbosscache.wizards.pages; import java.util.Collections; +import java.util.List; import org.eclipse.jface.viewers.IStructuredContentProvider; import org.eclipse.jface.viewers.Viewer; @@ -13,13 +14,7 @@ if(inputElement == null || inputElement.equals("")) return Collections.EMPTY_LIST.toArray(); - String[] params = (String[])inputElement; - - String element = params[0]; - boolean isDs = Boolean.parseBoolean(params[1]); - - - return new CacheLoaderPropModel().getPropertyModels(element,isDs).toArray(); + return ((List)inputElement).toArray(); } public void dispose() { 1.5 +1 -1 jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/CacheLoaderConfigurationPage.java (In the diff below, changes in quantity of whitespace are not shown.) Index: CacheLoaderConfigurationPage.java =================================================================== RCS file: /cvsroot/jboss/jbosside/cache/plugins/org.jboss.ide.eclipse.jbosscache/src/org/jboss/ide/eclipse/jbosscache/wizards/pages/CacheLoaderConfigurationPage.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -b -r1.4 -r1.5 --- CacheLoaderConfigurationPage.java 6 Jul 2006 19:48:56 -0000 1.4 +++ CacheLoaderConfigurationPage.java 9 Jul 2006 04:37:50 -0000 1.5 @@ -283,7 +283,7 @@ public void linkActivated(HyperlinkEvent e) { //Dialog open - CacheLoaderDefDialog dialog = new CacheLoaderDefDialog(getShell(),cmbCacheLoaderClass.getText()); + CacheLoaderDefDialog dialog = new CacheLoaderDefDialog(getShell(),cmbCacheLoaderClass.getText(),null); dialog.open(); } |