You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2008/04/23 12:23:47 UTC
svn commit: r650816 -
/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/
Author: pamarcelot
Date: Wed Apr 23 03:23:44 2008
New Revision: 650816
URL: http://svn.apache.org/viewvc?rev=650816&view=rev
Log:
Formatting and Javadoc.
Modified:
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ColorsAndFontsPage.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ConsoleDisplayMgr.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/MainPage.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Perspective.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PluginConstants.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PreferenceInitializer.java
directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/StudioConsoleAppender.java
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Activator.java Wed Apr 23 03:23:44 2008
@@ -34,7 +34,6 @@
import org.eclipse.debug.core.ILaunchConfigurationWorkingCopy;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
-import org.eclipse.debug.ui.IDebugUIConstants;
import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
import org.eclipse.jdt.launching.IVMInstall;
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ColorsAndFontsPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ColorsAndFontsPage.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ColorsAndFontsPage.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ColorsAndFontsPage.java Wed Apr 23 03:23:44 2008
@@ -20,15 +20,10 @@
package org.apache.directory.studio.apacheds.experimentations;
-import java.io.IOException;
-
-import javax.security.auth.login.LoginContext;
-
import org.eclipse.jface.preference.ColorSelector;
import org.eclipse.jface.preference.PreferenceConverter;
import org.eclipse.jface.preference.PreferencePage;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
import org.eclipse.swt.graphics.FontData;
import org.eclipse.swt.graphics.RGB;
import org.eclipse.swt.layout.GridData;
@@ -42,7 +37,6 @@
import org.eclipse.ui.IWorkbenchPreferencePage;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
-import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ConsoleDisplayMgr.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ConsoleDisplayMgr.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ConsoleDisplayMgr.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/ConsoleDisplayMgr.java Wed Apr 23 03:23:44 2008
@@ -1 +1 @@
-/*
* 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.
*
*/
package org.apache.directory.studio.apacheds.experimentations;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IDocument;
impo
rt org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
/**
* Create an instance of this class in any of your plugin classes.
*
* Use it as follows ...
*
* ConsoleDisplayMgr.getDefault().println("Some error msg", ConsoleDisplayMgr.MSG_ERROR);
* ...
* ...
* ConsoleDisplayMgr.getDefault().clear();
* ...
*/
public class ConsoleDisplayMgr
{
private static ConsoleDisplayMgr fDefault = null;
private String fTitle = null;
private MessageConsole fMessageConsole = null;
public static final int MSG_INFORMATION = 1;
public static final int MSG_ERROR = 2;
public static final in
t MSG_WARNING = 3;
public ConsoleDisplayMgr(String messageTitle)
{
fDefault = this;
fTitle = messageTitle;
}
public static ConsoleDisplayMgr getDefault() {
return fDefault;
}
public void println(String msg, int msgKind)
{
if( msg == null ) return;
/* if console-view in Java-perspective is not active, then show it and
* then display the message in the console attached to it */
if( !displayConsoleView() )
{
/*If an exception occurs while displaying in the console, then just diplay atleast the same in a message-box */
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error", msg);
return;
}
/* display message on console */
getNewMessageConsoleStream(msgKind).println(msg);
}
public void clear()
{
IDocument document = getMessageConsole().getDocument();
if (document != null) {
document.set("");
}
}
private boolean displayConsoleView()
{
try
{
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if( activeWorkbenchWindow != null )
{
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if( activePage != null )
activePage.showView(IConsoleConstants.ID_CONSOLE_VIEW, null, IWorkbenchPage.VIEW_VISIBLE);
}
} catch (PartInitException partEx) {
return false;
}
return true;
}
private MessageConsoleStream getNewMessageConsoleStream(int msgKind)
{
int swtColorId = SWT.COLOR_DARK_GREEN;
switch (msgKind)
{
case MSG_INFORMATION:
swtColorId = SWT.COLOR_DARK_GREEN;
break;
case MSG_ERROR:
swtColorId = SWT.COLOR_DARK_MAGENTA;
break;
case MSG_WARNING:
swtColorId = SWT.COLOR_DARK_BLUE;
break;
default:
}
MessageConsoleStream msgConsoleStream = getMessageConsole().newMessageStream();
// msgConsoleStream.setColor(Display.getCurrent().getSystemColor(swtColorId));
retur
n msgConsoleStream;
}
private MessageConsole getMessageConsole()
{
if( fMessageConsole == null )
createMessageConsoleStream(fTitle);
return fMessageConsole;
}
private void createMessageConsoleStream(String title)
{
fMessageConsole = new MessageConsole(title, null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ fMessageConsole });
}
}
\ No newline at end of file
+/*
* 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.
*
*/
package org.apache.directory.studio.apacheds.experimentations;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.text.IDocument;
impo
rt org.eclipse.swt.SWT;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
import org.eclipse.ui.console.IConsoleConstants;
import org.eclipse.ui.console.MessageConsole;
import org.eclipse.ui.console.MessageConsoleStream;
/**
* Create an instance of this class in any of your plugin classes.
*
* Use it as follows ...
*
* ConsoleDisplayMgr.getDefault().println("Some error msg", ConsoleDisplayMgr.MSG_ERROR);
* ...
* ...
* ConsoleDisplayMgr.getDefault().clear();
* ...
*/
public class ConsoleDisplayMgr
{
private static ConsoleDisplayMgr fDefault = null;
private String fTitle = null;
private MessageConsole fMessageConsole = null;
public static final int MSG_INFORMATION = 1;
public static final int MSG_ERROR = 2;
public static final int MSG_WARNING = 3;
public ConsoleDis
playMgr(String messageTitle)
{
fDefault = this;
fTitle = messageTitle;
}
public static ConsoleDisplayMgr getDefault() {
return fDefault;
}
public void println(String msg, int msgKind)
{
if( msg == null ) return;
/* if console-view in Java-perspective is not active, then show it and
* then display the message in the console attached to it */
if( !displayConsoleView() )
{
/*If an exception occurs while displaying in the console, then just diplay atleast the same in a message-box */
MessageDialog.openError(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), "Error", msg);
return;
}
/* display message on console */
getNewMessageConsoleStream(msgKind).println(msg);
}
public void clear()
{
IDocument document = getMessageConsole().getDocument();
if (document != null) {
document.set("");
}
}
private boolean displayConsoleView()
{
try
{
IWorkbenchWindow activeWorkbenchWindow
= PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if( activeWorkbenchWindow != null )
{
IWorkbenchPage activePage = activeWorkbenchWindow.getActivePage();
if( activePage != null )
activePage.showView(IConsoleConstants.ID_CONSOLE_VIEW, null, IWorkbenchPage.VIEW_VISIBLE);
}
} catch (PartInitException partEx) {
return false;
}
return true;
}
private MessageConsoleStream getNewMessageConsoleStream(int msgKind)
{
int swtColorId = SWT.COLOR_DARK_GREEN;
switch (msgKind)
{
case MSG_INFORMATION:
swtColorId = SWT.COLOR_DARK_GREEN;
break;
case MSG_ERROR:
swtColorId = SWT.COLOR_DARK_MAGENTA;
break;
case MSG_WARNING:
swtColorId = SWT.COLOR_DARK_BLUE;
break;
default:
}
MessageConsoleStream msgConsoleStream = getMessageConsole().newMessageStream();
// msgConsoleStream.setColor(Display.getCurrent().getSystemColor(swtColorId));
return msgConsoleStream;
}
private Messag
eConsole getMessageConsole()
{
if( fMessageConsole == null )
createMessageConsoleStream(fTitle);
return fMessageConsole;
}
private void createMessageConsoleStream(String title)
{
fMessageConsole = new MessageConsole(title, null);
ConsolePlugin.getDefault().getConsoleManager().addConsoles(new IConsole[]{ fMessageConsole });
}
}
\ No newline at end of file
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/MainPage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/MainPage.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/MainPage.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/MainPage.java Wed Apr 23 03:23:44 2008
@@ -38,7 +38,6 @@
*/
public class MainPage extends PreferencePage implements IWorkbenchPreferencePage
{
-
/**
* Creates a new instance of MainPage.
*/
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Perspective.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Perspective.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Perspective.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/Perspective.java Wed Apr 23 03:23:44 2008
@@ -25,13 +25,23 @@
import org.eclipse.ui.console.IConsoleConstants;
+/**
+ * This class implements the perspective of the plugin.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class Perspective implements IPerspectiveFactory
{
-
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.IPerspectiveFactory#createInitialLayout(org.eclipse.ui.IPageLayout)
+ */
public void createInitialLayout( IPageLayout layout )
{
+ // Getting the editors area
String editorArea = layout.getEditorArea();
+ // Adding the Console view
layout.addView( IConsoleConstants.ID_CONSOLE_VIEW, IPageLayout.BOTTOM, 0.66f, editorArea );
}
}
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PluginConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PluginConstants.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PluginConstants.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PluginConstants.java Wed Apr 23 03:23:44 2008
@@ -53,6 +53,6 @@
/** The Preference ID for the Fatal Font setting */
public static final String PREFS_COLORS_AND_FONTS_FATAL_FONT = "org.apache.directory.studio.apacheds.experimentations.prefs.colorAndFonts.fatalFont";
- /** The Preference ID for the Fatal Colors setting */
+ /** The Preference ID for the Fatal Color setting */
public static final String PREFS_COLORS_AND_FONTS_FATAL_COLOR = "org.apache.directory.studio.apacheds.experimentations.prefs.colorAndFonts.fatalColor";
}
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PreferenceInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PreferenceInitializer.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PreferenceInitializer.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/PreferenceInitializer.java Wed Apr 23 03:23:44 2008
@@ -42,6 +42,7 @@
*/
public void initializeDefaultPreferences()
{
+ // The preference store
IPreferenceStore store = Activator.getDefault().getPreferenceStore();
// Fonts
Modified: directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/StudioConsoleAppender.java
URL: http://svn.apache.org/viewvc/directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/StudioConsoleAppender.java?rev=650816&r1=650815&r2=650816&view=diff
==============================================================================
--- directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/StudioConsoleAppender.java (original)
+++ directory/sandbox/pamarcelot/studio-apacheds-plugin/studio-apacheds-experimentations/src/main/java/org/apache/directory/studio/apacheds/experimentations/StudioConsoleAppender.java Wed Apr 23 03:23:44 2008
@@ -20,31 +20,36 @@
package org.apache.directory.studio.apacheds.experimentations;
+import org.apache.log4j.Appender;
import org.apache.log4j.AppenderSkeleton;
import org.apache.log4j.Level;
import org.apache.log4j.spi.LoggingEvent;
+/**
+ * This class implements an {@link Appender} for the Console.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
public class StudioConsoleAppender extends AppenderSkeleton
{
-
/* (non-Javadoc)
* @see org.apache.log4j.AppenderSkeleton#append(org.apache.log4j.spi.LoggingEvent)
*/
- @Override
protected void append( LoggingEvent event )
{
Level level = event.getLevel();
Object message = event.getMessage();
- Activator.getDefault().getConsoleDisplayMgr().println( level + " " + message, ConsoleDisplayMgr.MSG_INFORMATION );
+ Activator.getDefault().getConsoleDisplayMgr()
+ .println( level + " " + message, ConsoleDisplayMgr.MSG_INFORMATION );
}
/* (non-Javadoc)
* @see org.apache.log4j.AppenderSkeleton#close()
*/
- @Override
public void close()
{
// TODO Auto-generated method stub
@@ -55,11 +60,9 @@
/* (non-Javadoc)
* @see org.apache.log4j.AppenderSkeleton#requiresLayout()
*/
- @Override
public boolean requiresLayout()
{
// TODO Auto-generated method stub
return false;
}
-
}