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 2007/08/29 17:23:41 UTC
svn commit: r570836 - in
/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor:
controller/ view/wizards/
Author: pamarcelot
Date: Wed Aug 29 08:23:41 2007
New Revision: 570836
URL: http://svn.apache.org/viewvc?rev=570836&view=rev
Log:
Hiding the Apache DS Online Schema capabilities of the Schema Editor.
Modified:
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizard.java
directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizardInformationPage.java
Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java?rev=570836&r1=570835&r2=570836&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java (original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/controller/SchemaViewController.java Wed Aug 29 08:23:41 2007
@@ -27,7 +27,6 @@
import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CollapseAllAction;
-import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.CommitChangesAction;
import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.DeleteSchemaElementAction;
import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ExportSchemasAsOpenLdapAction;
import org.apache.directory.studio.apacheds.schemaeditor.controller.actions.ExportSchemasAsXmlAction;
@@ -357,7 +356,7 @@
private OpenSchemaViewSortingDialogAction openSchemaViewSortingDialog;
private OpenSchemaViewPreferenceAction openSchemaViewPreference;
private LinkWithEditorSchemaViewAction linkWithEditor;
- private CommitChangesAction commitChanges;
+// private CommitChangesAction commitChanges;
/**
@@ -403,7 +402,7 @@
openSchemaViewSortingDialog = new OpenSchemaViewSortingDialogAction();
openSchemaViewPreference = new OpenSchemaViewPreferenceAction();
linkWithEditor = new LinkWithEditorSchemaViewAction( view );
- commitChanges = new CommitChangesAction();
+// commitChanges = new CommitChangesAction();
}
@@ -416,8 +415,8 @@
toolbar.add( newSchema );
toolbar.add( newAttributeType );
toolbar.add( newObjectClass );
- toolbar.add( new Separator() );
- toolbar.add( commitChanges );
+// toolbar.add( new Separator() );
+// toolbar.add( commitChanges );
toolbar.add( new Separator() );
toolbar.add( collapseAll );
toolbar.add( linkWithEditor );
@@ -507,7 +506,7 @@
linkWithEditor.setEnabled( true );
openSchemaViewSortingDialog.setEnabled( true );
openSchemaViewPreference.setEnabled( true );
- commitChanges.setEnabled( true );
+// commitChanges.setEnabled( true );
addSchemaHandlerListener( newProject );
view.reloadViewer();
@@ -523,7 +522,7 @@
linkWithEditor.setEnabled( false );
openSchemaViewSortingDialog.setEnabled( false );
openSchemaViewPreference.setEnabled( false );
- commitChanges.setEnabled( false );
+// commitChanges.setEnabled( false );
}
}
} );
@@ -835,7 +834,7 @@
linkWithEditor.setEnabled( true );
openSchemaViewSortingDialog.setEnabled( true );
openSchemaViewPreference.setEnabled( true );
- commitChanges.setEnabled( true );
+// commitChanges.setEnabled( true );
addSchemaHandlerListener( project );
view.reloadViewer();
@@ -850,7 +849,7 @@
linkWithEditor.setEnabled( false );
openSchemaViewSortingDialog.setEnabled( false );
openSchemaViewPreference.setEnabled( false );
- commitChanges.setEnabled( false );
+// commitChanges.setEnabled( false );
}
}
}
Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizard.java?rev=570836&r1=570835&r2=570836&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizard.java (original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizard.java Wed Aug 29 08:23:41 2007
@@ -20,18 +20,12 @@
package org.apache.directory.studio.apacheds.schemaeditor.view.wizards;
-import java.lang.reflect.InvocationTargetException;
-
import org.apache.directory.studio.apacheds.schemaeditor.Activator;
import org.apache.directory.studio.apacheds.schemaeditor.PluginUtils;
import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
import org.apache.directory.studio.apacheds.schemaeditor.model.Project;
import org.apache.directory.studio.apacheds.schemaeditor.model.ProjectType;
import org.apache.directory.studio.apacheds.schemaeditor.model.Schema;
-import org.apache.directory.studio.connection.core.Connection;
-import org.apache.directory.studio.connection.core.StudioProgressMonitor;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.Wizard;
@@ -51,7 +45,7 @@
// The pages of the wizard
private NewProjectWizardInformationPage informationPage;
- private NewProjectWizardConnectionSelectionPage connectionSelectionPage;
+// private NewProjectWizardConnectionSelectionPage connectionSelectionPage;
private NewProjectWizardSchemasSelectionPage schemasSelectionPage;
@@ -62,12 +56,12 @@
{
// Creating pages
informationPage = new NewProjectWizardInformationPage();
- connectionSelectionPage = new NewProjectWizardConnectionSelectionPage();
+// connectionSelectionPage = new NewProjectWizardConnectionSelectionPage();
schemasSelectionPage = new NewProjectWizardSchemasSelectionPage();
// Adding pages
addPage( informationPage );
- addPage( connectionSelectionPage );
+// addPage( connectionSelectionPage );
addPage( schemasSelectionPage );
}
@@ -77,34 +71,35 @@
*/
public boolean performFinish()
{
- final Project project = new Project( informationPage.getProjectType(), informationPage.getProjectName() );
- if ( informationPage.getProjectType().equals( ProjectType.APACHE_DIRECTORY_SERVER ) )
- {
- Connection connection = connectionSelectionPage.getSelectedConnection();
- project.setConnection( connection );
- try
- {
- getContainer().run( true, true, new IRunnableWithProgress()
- {
- public void run( IProgressMonitor monitor )
- {
- project.fetchOnlineSchema( new StudioProgressMonitor( monitor ) );
- }
- } );
- }
- catch ( InvocationTargetException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- catch ( InterruptedException e )
- {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- else if ( informationPage.getProjectType().equals( ProjectType.OFFLINE ) )
- {
+ Project project = new Project( ProjectType.OFFLINE, informationPage.getProjectName() );
+// final Project project = new Project( informationPage.getProjectType(), informationPage.getProjectName() );
+// if ( informationPage.getProjectType().equals( ProjectType.APACHE_DIRECTORY_SERVER ) )
+// {
+// Connection connection = connectionSelectionPage.getSelectedConnection();
+// project.setConnection( connection );
+// try
+// {
+// getContainer().run( true, true, new IRunnableWithProgress()
+// {
+// public void run( IProgressMonitor monitor )
+// {
+// project.fetchOnlineSchema( new StudioProgressMonitor( monitor ) );
+// }
+// } );
+// }
+// catch ( InvocationTargetException e )
+// {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+// catch ( InterruptedException e )
+// {
+// // TODO Auto-generated catch block
+// e.printStackTrace();
+// }
+// }
+// else if ( informationPage.getProjectType().equals( ProjectType.OFFLINE ) )
+// {
String[] selectedSchemas = schemasSelectionPage.getSelectedSchemas();
if ( selectedSchemas != null )
{
@@ -117,7 +112,7 @@
}
}
}
- }
+// }
ProjectsHandler projectsHandler = Activator.getDefault().getProjectsHandler();
projectsHandler.addProject( project );
@@ -127,44 +122,44 @@
}
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getNextPage( IWizardPage page )
- {
- if ( page.equals( informationPage ) )
- {
- if ( informationPage.getProjectType().equals( ProjectType.APACHE_DIRECTORY_SERVER ) )
- {
- return connectionSelectionPage;
- }
- else if ( informationPage.getProjectType().equals( ProjectType.OFFLINE ) )
- {
- return schemasSelectionPage;
- }
-
- // Default
- return null;
- }
-
- // Default
- return null;
- }
-
-
- /* (non-Javadoc)
- * @see org.eclipse.jface.wizard.Wizard#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
- */
- public IWizardPage getPreviousPage( IWizardPage page )
- {
- if ( ( page.equals( connectionSelectionPage ) ) || ( page.equals( schemasSelectionPage ) ) )
- {
- return informationPage;
- }
-
- // Default
- return null;
- }
+// /* (non-Javadoc)
+// * @see org.eclipse.jface.wizard.Wizard#getNextPage(org.eclipse.jface.wizard.IWizardPage)
+// */
+// public IWizardPage getNextPage( IWizardPage page )
+// {
+// if ( page.equals( informationPage ) )
+// {
+// if ( informationPage.getProjectType().equals( ProjectType.APACHE_DIRECTORY_SERVER ) )
+// {
+// return connectionSelectionPage;
+// }
+// else if ( informationPage.getProjectType().equals( ProjectType.OFFLINE ) )
+// {
+// return schemasSelectionPage;
+// }
+//
+// // Default
+// return null;
+// }
+//
+// // Default
+// return null;
+// }
+
+
+// /* (non-Javadoc)
+// * @see org.eclipse.jface.wizard.Wizard#getPreviousPage(org.eclipse.jface.wizard.IWizardPage)
+// */
+// public IWizardPage getPreviousPage( IWizardPage page )
+// {
+// if ( ( page.equals( connectionSelectionPage ) ) || ( page.equals( schemasSelectionPage ) ) )
+// {
+// return informationPage;
+// }
+//
+// // Default
+// return null;
+// }
/* (non-Javadoc)
@@ -182,10 +177,10 @@
{
return true;
}
- else if ( currentPage.equals( connectionSelectionPage ) )
- {
- return connectionSelectionPage.isPageComplete();
- }
+// else if ( currentPage.equals( connectionSelectionPage ) )
+// {
+// return connectionSelectionPage.isPageComplete();
+// }
else
{
return false;
@@ -198,6 +193,6 @@
*/
public void init( IWorkbench workbench, IStructuredSelection selection )
{
- setNeedsProgressMonitor( true );
+// setNeedsProgressMonitor( true );
}
}
Modified: directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizardInformationPage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizardInformationPage.java?rev=570836&r1=570835&r2=570836&view=diff
==============================================================================
--- directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizardInformationPage.java (original)
+++ directory/studio/trunk/studio-apacheds-schemaeditor/src/main/java/org/apache/directory/studio/apacheds/schemaeditor/view/wizards/NewProjectWizardInformationPage.java Wed Aug 29 08:23:41 2007
@@ -23,16 +23,13 @@
import org.apache.directory.studio.apacheds.schemaeditor.Activator;
import org.apache.directory.studio.apacheds.schemaeditor.PluginConstants;
import org.apache.directory.studio.apacheds.schemaeditor.controller.ProjectsHandler;
-import org.apache.directory.studio.apacheds.schemaeditor.model.ProjectType;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.plugin.AbstractUIPlugin;
@@ -53,8 +50,8 @@
// UI Fields
private Text nameText;
- private Button typeAdsRadio;
- private Button typeOfflineRadio;
+// private Button typeAdsRadio;
+// private Button typeOfflineRadio;
/**
@@ -64,7 +61,8 @@
{
super( "NewProjectWizardInformationPage" );
setTitle( "Create a Schema project." );
- setDescription( "Please specify a name and a type to create a new Schema project." );
+// setDescription( "Please specify a name and a type to create a new Schema project." );
+ setDescription( "Please specify a name to create a new Schema project." );
setImageDescriptor( AbstractUIPlugin.imageDescriptorFromPlugin( Activator.PLUGIN_ID,
PluginConstants.IMG_PROJECT_NEW_WIZARD ) );
projectsHandler = Activator.getDefault().getProjectsHandler();
@@ -92,19 +90,19 @@
dialogChanged();
}
} );
-
- // Type Group
- Group typeGroup = new Group( composite, SWT.NONE );
- typeGroup.setText( "Type" );
- typeGroup.setLayout( new GridLayout() );
- typeGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
-
- typeAdsRadio = new Button( typeGroup, SWT.RADIO );
- typeAdsRadio.setText( "Online Apache Directory Server Schema" );
- typeAdsRadio.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
- typeOfflineRadio = new Button( typeGroup, SWT.RADIO );
- typeOfflineRadio.setText( "Offline Schema" );
- typeOfflineRadio.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+//
+// // Type Group
+// Group typeGroup = new Group( composite, SWT.NONE );
+// typeGroup.setText( "Type" );
+// typeGroup.setLayout( new GridLayout() );
+// typeGroup.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false, 2, 1 ) );
+//
+// typeAdsRadio = new Button( typeGroup, SWT.RADIO );
+// typeAdsRadio.setText( "Online Apache Directory Server Schema" );
+// typeAdsRadio.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
+// typeOfflineRadio = new Button( typeGroup, SWT.RADIO );
+// typeOfflineRadio.setText( "Offline Schema" );
+// typeOfflineRadio.setLayoutData( new GridData( SWT.FILL, SWT.NONE, true, false ) );
initFields();
@@ -117,7 +115,7 @@
*/
private void initFields()
{
- typeAdsRadio.setSelection( true );
+// typeAdsRadio.setSelection( true );
displayErrorMessage( null );
setPageComplete( false );
@@ -170,23 +168,22 @@
return nameText.getText();
}
-
- /**
- * Gets the type of the project.
- *
- * @return
- * the type of the project
- */
- public ProjectType getProjectType()
- {
- if ( typeAdsRadio.getSelection() )
- {
- return ProjectType.APACHE_DIRECTORY_SERVER;
- }
- else
- {
- return ProjectType.OFFLINE;
- }
- }
-
+//
+// /**
+// * Gets the type of the project.
+// *
+// * @return
+// * the type of the project
+// */
+// public ProjectType getProjectType()
+// {
+// if ( typeAdsRadio.getSelection() )
+// {
+// return ProjectType.APACHE_DIRECTORY_SERVER;
+// }
+// else
+// {
+// return ProjectType.OFFLINE;
+// }
+// }
}