Author: hibou
Date: Tue Nov  6 23:01:07 2012
New Revision: 1406391

URL: http://svn.apache.org/viewvc?rev=1406391&view=rev
Log:
Add an option to open the Ivy console on startup

Modified:
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
    
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
    ant/ivy/ivyde/trunk/test/ivyde-namespace/.classpath

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/IvyPlugin.java
 Tue Nov  6 23:01:07 2012
@@ -34,6 +34,7 @@ import org.apache.ivyde.eclipse.cpcontai
 import org.apache.ivyde.eclipse.resolve.IvyResolveJob;
 import org.apache.ivyde.eclipse.retrieve.RetrieveSetupManager;
 import org.apache.ivyde.eclipse.ui.console.IvyConsole;
+import org.apache.ivyde.eclipse.ui.console.IvyConsoleFactory;
 import org.apache.ivyde.eclipse.ui.editors.xml.ColorManager;
 import org.apache.ivyde.eclipse.ui.preferences.IvyDEPreferenceStoreHelper;
 import org.apache.ivyde.eclipse.ui.preferences.PreferenceConstants;
@@ -154,6 +155,9 @@ public class IvyPlugin extends AbstractU
 
         try {
             console = new IvyConsole();
+            if (prefStoreHelper.isOpenIvyConsoleOnStartup()) {
+                IvyConsoleFactory.showConsole();
+            }
         } catch (RuntimeException e) {
             // Don't let the console bring down the IvyDE UI
             logError("Errors occurred starting the Ivy console", e);

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyDEPreferenceStoreHelper.java
 Tue Nov  6 23:01:07 2012
@@ -210,6 +210,14 @@ public class IvyDEPreferenceStoreHelper 
         prefStore.setValue(PreferenceConstants.IVY_CONSOLE_LOG_LEVEL, 
logLevel);
     }
 
+    public boolean isOpenIvyConsoleOnStartup() {
+        return 
prefStore.getBoolean(PreferenceConstants.OPEN_IVY_CONSOLE_ON_STARTUP);
+    }
+
+    public void setOpenIvyConsoleOnStartup(boolean openOnStartup) {
+        prefStore.setValue(PreferenceConstants.OPEN_IVY_CONSOLE_ON_STARTUP, 
openOnStartup);
+    }
+
     public boolean getIgnoreBranchOnWorkspaceProjects() {
         return 
prefStore.getBoolean(PreferenceConstants.IGNORE_BRANCH_ON_WORKSPACE_PROJECTS);
     }

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/IvyPreferencePage.java
 Tue Nov  6 23:01:07 2012
@@ -20,7 +20,6 @@ package org.apache.ivyde.eclipse.ui.pref
 import org.apache.ivy.Ivy;
 import org.apache.ivyde.eclipse.IvyPlugin;
 import org.apache.ivyde.eclipse.cpcontainer.IvyClasspathInitializer;
-import org.eclipse.core.runtime.IStatus;
 import org.eclipse.jface.preference.PreferencePage;
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.layout.GridData;
@@ -61,6 +60,8 @@ public class IvyPreferencePage extends P
 
     private Button doNothingOnStartupButton;
 
+    private Button openIvyConsoleOnStartupButton;
+
     private Button resolveOnChangeButton;
 
     private Button doNothingOnChangeButton;
@@ -95,6 +96,11 @@ public class IvyPreferencePage extends P
         offlineButton.setLayoutData(new GridData(GridData.FILL, GridData.FILL, 
true, false, 3, 1));
         offlineButton.setText("Offline (use only the caches)");
 
+        openIvyConsoleOnStartupButton = new Button(composite, SWT.CHECK);
+        openIvyConsoleOnStartupButton.setLayoutData(new 
GridData(GridData.FILL, GridData.FILL, true,
+                false));
+        openIvyConsoleOnStartupButton.setText("Open the Ivy console on 
startup");
+
         Group startupGroup = new Group(composite, SWT.NONE);
         startupGroup.setLayoutData(new GridData(GridData.FILL, GridData.FILL, 
true, false));
         startupGroup.setLayout(new GridLayout());
@@ -181,6 +187,8 @@ public class IvyPreferencePage extends P
             doNothingOnChangeButton.setSelection(true);
         }
 
+        
openIvyConsoleOnStartupButton.setSelection(helper.isOpenIvyConsoleOnStartup());
+        
         organizationText.setText(helper.getIvyOrg());
         organizationUrlText.setText(helper.getIvyOrgUrl());
 
@@ -205,6 +213,8 @@ public class IvyPreferencePage extends P
             helper.setAutoResolveOnChange(false);
         }
 
+        
helper.setOpenIvyConsoleOnStartup(openIvyConsoleOnStartupButton.getSelection());
+
         helper.setOrganization(organizationText.getText());
         helper.setOrganizationUrl(organizationUrlText.getText());
 
@@ -235,6 +245,9 @@ public class IvyPreferencePage extends P
             doNothingOnChangeButton.setSelection(true);
         }
 
+        openIvyConsoleOnStartupButton
+                
.setSelection(PreferenceInitializer.DEFAULT_OPEN_IVY_CONSOLE_ON_STARTUP);
+
         organizationText.setText(PreferenceInitializer.DEFAULT_ORGANISATION);
         
organizationUrlText.setText(PreferenceInitializer.DEFAULT_ORGANISATION_URL);
 

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceConstants.java
 Tue Nov  6 23:01:07 2012
@@ -93,6 +93,8 @@ public final class PreferenceConstants {
 
     public static final String IVY_CONSOLE_LOG_LEVEL = "ivyConsole.logLevel";
 
+    public static final String OPEN_IVY_CONSOLE_ON_STARTUP = 
"ivyConsole.openOnStartup";
+
     public static final String IGNORE_BRANCH_ON_WORKSPACE_PROJECTS
         = "workspaceResolver.ignoreBranch";
 

Modified: 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
 (original)
+++ 
ant/ivy/ivyde/trunk/org.apache.ivyde.eclipse/src/java/org/apache/ivyde/eclipse/ui/preferences/PreferenceInitializer.java
 Tue Nov  6 23:01:07 2012
@@ -106,6 +106,8 @@ public class PreferenceInitializer exten
 
     public static final int DEFAULT_IVY_CONSOLE_LOG_MESSAGE = Message.MSG_INFO;
 
+    public static final boolean DEFAULT_OPEN_IVY_CONSOLE_ON_STARTUP = false;
+
     public static final MappingSetup DEFAULT_MAPPING_SETUP = new 
MappingSetup();
 
     static {
@@ -177,6 +179,7 @@ public class PreferenceInitializer exten
         store.setDefault(PreferenceConstants.AUTO_RESOLVE_ON_CHANGE, 
DEFAULT_AUTO_RESOLVE_ON_CHANGE);
 
         store.setDefault(PreferenceConstants.IVY_CONSOLE_LOG_LEVEL, 
DEFAULT_IVY_CONSOLE_LOG_MESSAGE);
+        store.setDefault(PreferenceConstants.OPEN_IVY_CONSOLE_ON_STARTUP, 
DEFAULT_OPEN_IVY_CONSOLE_ON_STARTUP);
 
         
store.setDefault(PreferenceConstants.IGNORE_BRANCH_ON_WORKSPACE_PROJECTS,
             DEFAULT_IGNORE_BRANCH_ON_WORKSPACE_PROJECTS);

Modified: ant/ivy/ivyde/trunk/test/ivyde-namespace/.classpath
URL: 
http://svn.apache.org/viewvc/ant/ivy/ivyde/trunk/test/ivyde-namespace/.classpath?rev=1406391&r1=1406390&r2=1406391&view=diff
==============================================================================
--- ant/ivy/ivyde/trunk/test/ivyde-namespace/.classpath (original)
+++ ant/ivy/ivyde/trunk/test/ivyde-namespace/.classpath Tue Nov  6 23:01:07 2012
@@ -1,25 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!--
-   Licensed to the Apache Software Foundation (ASF) under one
-   or more contributor license agreements.  See the NOTICE file
-   distributed with this work for additional information
-   regarding copyright ownership.  The ASF licenses this file
-   to you under the Apache License, Version 2.0 (the
-   "License"); you may not use this file except in compliance
-   with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
-   Unless required by applicable law or agreed to in writing,
-   software distributed under the License is distributed on an
-   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-   KIND, either express or implied.  See the License for the
-   specific language governing permissions and limitations
-   under the License.    
--->
 <classpath>
        <classpathentry kind="src" path="src"/>
        <classpathentry kind="con" 
path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-       <classpathentry kind="con" 
path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=ivydetest-ivyde-namespace&amp;ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=%24%7Bworkspace_loc%3Aivydetest-ivyde-namespace%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;propertyFiles=&amp;acceptedTypes=jar&amp;sourceTypes=source&amp;javadocTypes=javadoc&amp;sourceSuffixes=-source%2C-sources%2C-src&amp;javadocSuffixes=-javadoc%2C-javadocs%2C-doc%2C-docs&amp;alphaOrder=false&amp;resolveInWorkspace=false&amp;resolveBeforeLaunch=false&amp;retrievedClasspath=false&amp;mapIfOnlyOneSource=false&amp;mapIfOnlyOneJavadoc=false&amp;useExtendedResolveId=false"/>
+       <classpathentry kind="con" 
path="org.apache.ivyde.eclipse.cpcontainer.IVYDE_CONTAINER/?project=ivydetest-ivyde-namespace&amp;ivyXmlPath=ivy.xml&amp;confs=*&amp;ivySettingsPath=%24%7Bworkspace_loc%3Aivydetest-ivyde-namespace%2Fivysettings.xml%7D&amp;loadSettingsOnDemand=false&amp;ivyUserDir=&amp;propertyFiles=&amp;acceptedTypes=jar&amp;alphaOrder=false&amp;resolveInWorkspace=false&amp;readOSGiMetadata=false&amp;retrievedClasspath=false&amp;sourceTypes=source&amp;javadocTypes=javadoc&amp;sourceSuffixes=-source%2C-sources%2C-src&amp;javadocSuffixes=-javadoc%2C-javadocs%2C-doc%2C-docs&amp;mapIfOnlyOneSource=false&amp;mapIfOnlyOneJavadoc=false&amp;resolveBeforeLaunch=false&amp;useExtendedResolveId=false"/>
        <classpathentry kind="output" path="bin"/>
 </classpath>


Reply via email to