[jboss-cvs] jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs ...

Robert Stryker rawblem at gmail.com
Thu Nov 9 19:30:23 EST 2006


  User: rawb    
  Date: 06/11/09 19:30:23

  Modified:    as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs 
                        TwiddleDialog.java
  Log:
  Rewrote ui entirely
  
  Revision  Changes    Path
  1.8       +32 -51    jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: TwiddleDialog.java
  ===================================================================
  RCS file: /cvsroot/jboss/jbosside/as/plugins/org.jboss.ide.eclipse.as.ui/jbossui/org/jboss/ide/eclipse/as/ui/dialogs/TwiddleDialog.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -b -r1.7 -r1.8
  --- TwiddleDialog.java	20 Sep 2006 21:03:43 -0000	1.7
  +++ TwiddleDialog.java	10 Nov 2006 00:30:23 -0000	1.8
  @@ -1,24 +1,3 @@
  -/*
  - * JBoss, Home of Professional Open Source
  - * Copyright 2006, JBoss Inc., and individual contributors as indicated
  - * by the @authors tag. See the copyright.txt in the distribution for a
  - * full listing of individual contributors.
  - *
  - * This is free software; you can redistribute it and/or modify it
  - * under the terms of the GNU Lesser General Public License as
  - * published by the Free Software Foundation; either version 2.1 of
  - * the License, or (at your option) any later version.
  - *
  - * This software is distributed in the hope that it will be useful,
  - * but WITHOUT ANY WARRANTY; without even the implied warranty of
  - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  - * Lesser General Public License for more details.
  - *
  - * You should have received a copy of the GNU Lesser General Public
  - * License along with this software; if not, write to the Free
  - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
  - * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
  - */
   package org.jboss.ide.eclipse.as.ui.dialogs;
   
   import java.net.URL;
  @@ -48,23 +27,23 @@
   import org.eclipse.ui.forms.events.HyperlinkEvent;
   import org.eclipse.ui.forms.events.IHyperlinkListener;
   import org.eclipse.ui.forms.widgets.Hyperlink;
  +import org.eclipse.wst.server.core.IServer;
   import org.eclipse.wst.server.ui.internal.ServerUIPlugin;
  -import org.jboss.ide.eclipse.as.core.client.TwiddleLauncher;
  -import org.jboss.ide.eclipse.as.core.client.TwiddleLauncher.TwiddleLogEvent;
  +import org.jboss.ide.eclipse.as.core.model.ServerProcessModel;
   import org.jboss.ide.eclipse.as.core.model.ServerProcessModel.ServerProcessModelEntity;
  -import org.jboss.ide.eclipse.as.core.server.JBossLaunchConfigurationDelegate;
   import org.jboss.ide.eclipse.as.core.server.JBossServer;
  -import org.jboss.ide.eclipse.as.core.server.JBossServerBehavior;
  -import org.jboss.ide.eclipse.as.ui.JBossServerUISharedImages;
  +import org.jboss.ide.eclipse.as.core.server.JBossServerLaunchConfiguration;
  +import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher;
  +import org.jboss.ide.eclipse.as.core.server.TwiddleLauncher.ProcessData;
   import org.jboss.ide.eclipse.as.ui.Messages;
   
   public class TwiddleDialog extends Dialog {
   
  -	private static final int EXECUTE_ID = 804;
  +	private static final int EXECUTE_ID = 2042;
   	private Text query, results;
   	private Label queryLabel;
   	private ServerProcessModelEntity entity = null;
  -	private JBossServer server = null;
  +	private IServer server = null;
   	private Composite parentComposite;
   	private Hyperlink twiddleTutorialLink;
   	
  @@ -73,16 +52,16 @@
   		super(parentShell);
   		setShellStyle(getShellStyle() | SWT.RESIZE);
   		Object o = selection.getFirstElement();
  -		if( o instanceof JBossServer ) {
  -			server = (JBossServer)o;
  -			entity = server.getProcessModel();
  +		if( o instanceof IServer ) {
  +			server = (IServer)o;
  +			entity = ServerProcessModel.getDefault().getModel(server.getId());
   		}
   
   	}
   	protected void configureShell(Shell newShell) {
   		super.configureShell(newShell);
   		newShell.setText(Messages.TwiddleDialog);
  -		newShell.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.TWIDDLE_IMAGE));
  +		//newShell.setImage(JBossServerUISharedImages.getImage(JBossServerUISharedImages.TWIDDLE_IMAGE));
   	}
   	   
   	protected Point getInitialSize() {
  @@ -107,15 +86,16 @@
   	protected void executePressed() {
   		final String args = query.getText();
   		final Display dis = getShell().getDisplay();
  -		final JBossServer jbs = server;
  +		final IServer jbs = server;
   		final ServerProcessModelEntity spme = entity;
   		getButton(EXECUTE_ID).setEnabled(false);
   		Thread t = new Thread() {
   			public void run() {
   				try {
  -					TwiddleLauncher launcher = new TwiddleLauncher(3000, 100);
  -					final TwiddleLogEvent launchEvent = launcher.getTwiddleResults(spme, jbs, args, false);
  -					final String s2 = launchEvent.getOut();
  +					TwiddleLauncher launcher = new TwiddleLauncher();
  +					final ProcessData[] datas = launcher.getTwiddleResults(jbs, args, false);
  +					if( datas.length == 1 ) {
  +						final String s2 = datas[0].getOut();
   					dis.asyncExec(new Runnable() {
   						public void run() {
   							// reset the default button, focus on the query, and 
  @@ -130,6 +110,7 @@
   							}
   						} 
   					} );
  +					}
   				} catch( Exception e ) {
   					e.printStackTrace();
   				}
  @@ -213,7 +194,7 @@
   		
   		// set the default text
   		try {
  -			ILaunchConfiguration config = JBossLaunchConfigurationDelegate.setupLaunchConfiguration(server, JBossServerBehavior.ACTION_TWIDDLE);
  +			ILaunchConfiguration config = JBossServerLaunchConfiguration.setupLaunchConfiguration(server, JBossServerLaunchConfiguration.TWIDDLE);
   			String args = config.getAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, "");
   			query.setText(args);
   			query.setFocus();
  
  
  



More information about the jboss-cvs-commits mailing list