[jbosstools-commits] JBoss Tools SVN: r24245 - trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor.

jbosstools-commits at lists.jboss.org jbosstools-commits at lists.jboss.org
Wed Aug 18 01:51:05 EDT 2010


Author: rob.stryker at jboss.com
Date: 2010-08-18 01:51:05 -0400 (Wed, 18 Aug 2010)
New Revision: 24245

Modified:
   trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
Log:
JBIDE-6858 - NPE when using local copy server type

Modified: trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java
===================================================================
--- trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java	2010-08-18 01:12:08 UTC (rev 24244)
+++ trunk/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/editor/DeploymentModuleOptionCompositeAssistant.java	2010-08-18 05:51:05 UTC (rev 24245)
@@ -190,12 +190,7 @@
 		Composite inner = toolkit.createComposite(composite);
 		inner.setLayout(new GridLayout(1, false));
 
-		IRuntime rt = getServer().getServer().getRuntime();
-		boolean showRadios = true;
-		if( rt == null || rt.loadAdapter(IJBossServerRuntime.class, null) == null)
-			showRadios = false;
-
-		if( showRadios ) {
+		if( getShowRadios() ) {
 			metadataRadio = toolkit.createButton(inner,
 					Messages.EditorUseWorkspaceMetadata, SWT.RADIO);
 			serverRadio = toolkit.createButton(inner,
@@ -356,19 +351,31 @@
 		return section;
 	}
 	
+	protected boolean getShowRadios() {
+		IRuntime rt = getServer().getServer().getRuntime();
+		boolean showRadios = true;
+		if( rt == null || rt.loadAdapter(IJBossServerRuntime.class, null) == null)
+			showRadios = false;
+		return showRadios;
+	}
+	
 	private void updateWidgets() {
-		metadataRadio.setSelection(getDeployType().equals(
-				IDeployableServer.DEPLOY_METADATA));
-		serverRadio.setSelection(getDeployType().equals(
-				IDeployableServer.DEPLOY_SERVER));
-		customRadio.setSelection(getDeployType().equals(
-				IDeployableServer.DEPLOY_CUSTOM));
-		currentSelection = metadataRadio.getSelection() ? metadataRadio
-				: serverRadio.getSelection() ? serverRadio : customRadio;
+		if( getShowRadios()) {
+			metadataRadio.setSelection(getDeployType().equals(
+					IDeployableServer.DEPLOY_METADATA));
+			serverRadio.setSelection(getDeployType().equals(
+					IDeployableServer.DEPLOY_SERVER));
+			customRadio.setSelection(getDeployType().equals(
+					IDeployableServer.DEPLOY_CUSTOM));
+			currentSelection = metadataRadio.getSelection() ? metadataRadio
+					: serverRadio.getSelection() ? serverRadio : customRadio;
+			
+			String mode = page.getServer().getAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
+			boolean metaEnabled = callbackMappings.get(mode).metadataEnabled();
+			metadataRadio.setEnabled(metaEnabled);
+		}
 		
-		String mode = page.getServer().getAttribute(IDeployableServer.SERVER_MODE, LocalPublishMethod.LOCAL_PUBLISH_METHOD);
-		boolean metaEnabled = callbackMappings.get(mode).metadataEnabled();
-		metadataRadio.setEnabled(metaEnabled);
+		
 		JBossServer jbs = ServerConverter.getJBossServer(page.getServer().getOriginal());
 		String newDir = getHelper().getAttribute(IDeployableServer.DEPLOY_DIRECTORY, 
 				jbs == null ? "" : jbs.getDeployFolder(jbs, getDeployType()));



More information about the jbosstools-commits mailing list