Skip to content

Commit

Permalink
Remove dependencies on ldapbrowser.ui
Browse files Browse the repository at this point in the history
* The ui plugin provides the ldap browser perspective and view. This are
  not necessary for use with the BrowserWidget

* ModelGeneratorLdapUiPlugin
 * Remove reference to ui bundle as no longer need to start it

* LdapTablesPage
 * Removes showSearchesAction and showBookmarksActions
 * Removes the empty dropdown menu manager from widget's view form since
   it is now empty
  • Loading branch information
Paul Richardson committed May 28, 2015
1 parent 9f608c0 commit 06ed20d
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 34 deletions.
Expand Up @@ -42,8 +42,7 @@ Require-Bundle: org.eclipse.ui;bundle-version="[3.106.0,4.0.0)",
org.apache.directory.studio.connection.core;bundle-version="2.0.0",
org.apache.directory.studio.connection.ui;bundle-version="2.0.0",
org.apache.directory.studio.ldapbrowser.common;bundle-version="2.0.0",
org.apache.directory.studio.ldapbrowser.core;bundle-version="2.0.0",
org.apache.directory.studio.ldapbrowser.ui;bundle-version="2.0.0"
org.apache.directory.studio.ldapbrowser.core;bundle-version="2.0.0"
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Import-Package: org.teiid.designer.schema.tools.processing
Expand Up @@ -7,11 +7,9 @@
*/
package org.teiid.designer.modelgenerator.ldap.ui;

import org.eclipse.core.runtime.Platform;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.dialogs.IDialogSettings;
import org.eclipse.ui.IWorkbenchPage;
import org.osgi.framework.Bundle;
import org.osgi.framework.BundleContext;
import org.teiid.core.designer.PluginUtil;
import org.teiid.core.designer.util.PluginUtilImpl;
Expand All @@ -27,8 +25,6 @@
*/
public final class ModelGeneratorLdapUiPlugin extends AbstractUiPlugin implements ModelGeneratorLdapUiConstants {

private static final String LDAP_BROWSER_UI_PLUGIN_ID = "org.apache.directory.studio.ldapbrowser.ui"; //$NON-NLS-1$

///////////////////////////////////////////////////////////////////////////////////////////////
// FIELDS
///////////////////////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -95,14 +91,6 @@ public void start(final BundleContext context) throws Exception {

// Initialize logging/i18n/debugging utility
((PluginUtilImpl)UTIL).initializePlatformLogger(this);

//
// Ensure that the browser.ui plugin is fully started before using
// any of the ldap-related wizards. This is due to
// https://issues.apache.org/jira/browse/DIRSTUDIO-1046
//
Bundle ldapBrowserBundle = Platform.getBundle(LDAP_BROWSER_UI_PLUGIN_ID);
ldapBrowserBundle.start();
}

/**
Expand Down
Expand Up @@ -69,7 +69,6 @@ public Object[] getChildren(Object parentElement) {
Map<Integer, ILdapAttributeNode> childAttributes = new HashMap<Integer, ILdapAttributeNode>();

for (IEntry child : children) {
System.out.println("Child of " + parentNode.getSourceBaseName() + " is " + child.getDn());
// Making sure attributes are initialized
if (! child.isAttributesInitialized()) {
NullProgressMonitor ipm = new NullProgressMonitor();
Expand Down
Expand Up @@ -14,8 +14,7 @@
import org.apache.directory.studio.ldapbrowser.common.widgets.browser.BrowserWidget;
import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
import org.apache.directory.studio.ldapbrowser.ui.views.browser.ShowBookmarksAction;
import org.apache.directory.studio.ldapbrowser.ui.views.browser.ShowSearchesAction;
import org.apache.directory.studio.ldapbrowser.core.model.impl.SearchResult;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ToolBarManager;
import org.eclipse.jface.dialogs.IMessageProvider;
Expand All @@ -34,6 +33,7 @@
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.SashForm;
import org.eclipse.swt.custom.ViewForm;
import org.eclipse.swt.events.ModifyEvent;
import org.eclipse.swt.events.ModifyListener;
import org.eclipse.swt.events.SelectionAdapter;
Expand Down Expand Up @@ -88,10 +88,6 @@ public class LdapTablesPage extends WizardPage

private BrowserUniversalListener universalListener;

private ShowSearchesAction showSearchesAction;

private ShowBookmarksAction showBookmarksAction;

private TreeViewer entryViewer;

private LdapConnectionContentProvider entryContentProvider;
Expand Down Expand Up @@ -355,6 +351,9 @@ public void run() {
Iterator<Object> iter = sselection.iterator();
while (iter.hasNext()) {
Object next = iter.next();
if (next instanceof SearchResult)
next = ((SearchResult)next).getEntry();

if (!(next instanceof IEntry))
continue;

Expand Down Expand Up @@ -382,11 +381,12 @@ public void doubleClick(DoubleClickEvent event) {
//
widget.getInfoText().setVisible(false);

showSearchesAction = new ShowSearchesAction();
showBookmarksAction = new ShowBookmarksAction();
widget.getMenuManager().add(showSearchesAction);
widget.getMenuManager().add(showBookmarksAction);
widget.getMenuManager().update(true);
//
// Remove the drop down menu from the toolbar
// since it is empty
//
ViewForm composite = (ViewForm) widget.getControl();
composite.setTopRight(null);

//
// The chosen-entries side of the splitter
Expand Down Expand Up @@ -553,14 +553,6 @@ private void initBrowserWidget() {

BrowserQuickSearchWidget quickSearchWidget = widget.getQuickSearchWidget();
quickSearchWidget.setInput(browserConnection);

//
// Turn off bookmarks and searches by default
//
showBookmarksAction.setChecked(false);
showBookmarksAction.run();
showSearchesAction.setChecked(false);
showSearchesAction.run();
}

@Override
Expand Down

0 comments on commit 06ed20d

Please sign in to comment.