Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sqldeveloper/extension/.classpath
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/FXDiagram 0.35.0-SNAPSHOT"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/KIELER KLay Layouters v. 2015.02"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SQLDeveloper 4.2"/>
<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/SQLDeveloper 18.1"/>
<classpathentry kind="output" path="built/classes"/>
</classpath>
7 changes: 7 additions & 0 deletions sqldeveloper/extension/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@ Depending on requirements, this can be done in either XML or java and deployed b

### Contents

* [Set Up / Tutorial](./setup.md) - A step by step guide to building your first extension and check for updates bundle.


* ["Simple" User Extensions (XML)](xml)


* [Standard Extensions (java)](java)


* [Check For Updates (cfu)](cfu)

3 changes: 2 additions & 1 deletion sqldeveloper/extension/build.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
# Where sqldev lives. The directory that sqldeveloper/bin is in.
# This is where the builds will deploy the extension
# and where we can find our dependencies
sqldev.dir=D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper
#sqldev.dir=D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper
sqldev.dir=D:/sqldeveloper-18.1.0/sqldeveloper

# Information about the company or person creating the extension
extension.owner=Oracle Examples
Expand Down
3 changes: 2 additions & 1 deletion sqldeveloper/extension/buildtools/ant/classpaths.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ limitations under the License.

<!-- osgi.bundle.utils-nodeps -->
<property name="osgi.bundle.utils-nodeps" value="oracle.sqldeveloper.utils-nodeps" />
<property name="dbtools.common.jarfile" value="oracle.dbtools-common.jar"/>
<!-- 4.2 <property name="dbtools.common.jarfile" value="oracle.dbtools-common.jar"/> -->
<property name="dbtools.common.jarfile" value="dbtools-common.jar"/>
<path id="oracle.sqldeveloper.utils-nodeps">
<pathelement location="${sqldev.lib}/${dbtools.common.jarfile}" />
</path>
Expand Down
2 changes: 1 addition & 1 deletion sqldeveloper/extension/cfu/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SQL Developer Examples
## Check For Updates (cfu)
This is a bit of a table of contents trick to bring cfu closer to the top.
Go to one of the projects and run the cfu ant task. The results will be in the built/cfu directory in the project.
Go to one of the projects and run the _cfu ant task. The results will be in the built/cfu directory in the project.
* [Packaged XML extension](../xml/packaged)
* [Java extension](../java/DependencyExample)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added sqldeveloper/extension/images/get-examples.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extension.id=oracle.db.example.sqldeveloper.extension.contextMenuAction
extension.name=Context Menu Action
extension.descr=Example context menu action on FUNCTION, PROCEURE code editor to insert static string
extension.version=1.0.0
extension.version=18.1.0
extension.resources=oracle.db.example.sqldeveloper.extension.contextMenuAction.ExtensionResources

extension.lib=external:$oracle.fcp.home$/sqldeveloper/extensions/${extension.id}/lib
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<eclipse-userlibraries version="2">
<library name="FXDiagram 0.35.0-SNAPSHOT" systemlibrary="false">
<archive path="/extension/java/DependencyExample/lib/com.google.guava-15.0.0.v201403281430.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.cau.cs.kieler.kiml.graphviz.layouter-0.7.0.201506231527.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.cau.cs.kieler.kiml.graphviz.dot-0.7.1.201612130921.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.annotations-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.core-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.external-0.35.0-SNAPSHOT.jar"/>
Expand Down
22 changes: 19 additions & 3 deletions sqldeveloper/extension/java/DependencyExample/README.md
Original file line number Diff line number Diff line change
@@ -1,20 +1,36 @@
# SQL Developer Examples
## DependencyExample
This example is built with ant but is also set up for editing & (remote) debugging in the eclipse extension project.
This example is built with ant but is also set up for editing & (remote) debugging in the eclipse extension project.
* Building this example requires two external libraries. Copy the required jar files to DependencyExample/lib.
The exact jars needed from them can be found in *DependencyExample/DependencyExample.userlibraries* which you will also need to import to use eclipse.
* [FXDiagram 0.35.0](http://dl.bintray.com/jankoehnlein/FXDiagram/standalone/:fxdiagram-jars-0.35.0.zip "fxdiagram-jars-0.35.0.zip")
* [FXDiagram 0.35.0](http://dl.bintray.com/jankoehnlein/FXDiagram/standalone/fxdiagram-jars-0.35.0.zip "fxdiagram-jars-0.35.0.zip")
* [KIELER KLay Layouters 0.14.0](http://rtsys.informatik.uni-kiel.de/~kieler/files/release_pragmatics_2015-02/klay/klay_2015-02.jar "klay_2015-02.jar")

[Set up your environment](../../setup.md), get the required libraries (see above), build the (default) deploy target, and start SQLDeveloper from the command line WITH THE (sqldeveloper/bin/)sqldeveloper -clean OPTION.

On the first run, only the triggers defined in extension.xml will load.

![DependencyExampleAbout diagram](images/DependencyExampleAbout.png)

In our case, that means the context menu entry only and NOT the dependency viewer tab referenced in the hook section (via DependencyExampleGraphViewer.xml which is in the directory the hook says to load xml from)

![DependencyExampleContextMenu diagram](images/DependencyExampleContextMenu.png)

Which opens the dependency diagram AND causes the rest of the extension hooks to load. (The editor tab name is pulled from the 1st selected node but will switch when focus goes to another editor and back. TODO: This really should be implemented as it's own dockable, not as an 'editor'.)

![DependencyExampleZoomedOut diagram](images/DependencyExampleZoomedOut.png)
the diagram is scrollable, zoomable, editable, and can be exported to svg (all thanks to the FXDiagram library.) Double clicking on a node performs a "DrillLink" to open the SQL Developer editor for that node.

The diagram is scrollable, zoomable, editable, and can be exported to svg (all thanks to the FXDiagram library.)
Controls:
* Scroll with mouse wheel
* Zoom with Ctrl + mouse wheel
* Select with left click, Ctrl+left click to add to selection, or draw bounding box with mouse
* Move nodes / selection / diagram by holding down right mouse button & dragging. Left button also works for node / selection
* Double clicking on a node performs a "DrillLink" to open the SQL Developer editor for that node.
* Right click brings up context menu. Hover over icons to see what is available. Note that do / undo refer to changes made to the diagram since opening it.

![DependencyExampleZoomedIn diagram](images/DependencyExampleZoomedIn.png)

Now that it is fully loaded, the viewer definition is active and a dependency graph tab is added to the object viewers. (The next time a new one is opened.)

![DependencyExampleViewer diagram](images/DependencyExampleViewer.png)
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extension.id=oracle.db.example.sqldeveloper.extension.dependency
extension.name=Example Dependency Viewer
extension.descr=Object viewer(s) for dependency analysis
extension.version=1.0.0
extension.version=18.1.0
extension.resources=oracle.db.example.sqldeveloper.extension.dependency.DependencyExampleResources
# Note that there are attribution and potential license requirements if you DISTRIBUTE
# this example with the third party libraries included.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ private Editor openEditor(Context context) {
*/
@Override
public boolean update(IdeAction action, Context context) {
action.setEnabled(true);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import oracle.dbtools.raptor.ui.URLFileChooser;
import oracle.dbtools.util.Logger;
import oracle.ide.Ide;
import oracle.ide.controls.WaitCursor;

/**
* DependencyExampleFxControl an javaFX custom control to contain the vworkflow UI
Expand Down Expand Up @@ -183,14 +184,18 @@ public DependencyExampleModel getViewModel() {

/**
* @param aViewModel the viewModel to set
* @param waitCursor
*/
public void setViewModel(DependencyExampleModel aViewModel) {
public void setViewModel(DependencyExampleModel aViewModel, final WaitCursor waitCursor) {
viewModel = aViewModel;
Platform.runLater(() -> {
getViewModel().load();
updateUI();
diagram.applyCss();
diagram.layout();
SwingUtilities.invokeLater(() -> {
waitCursor.hide();
});
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ Everyone is permitted to copy and distribute copies of this Agreement, but in or
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.geometry.Insets;
import javafx.scene.Cursor;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseButton;
import javafx.scene.input.MouseEvent;
Expand Down Expand Up @@ -239,17 +238,12 @@ public void handle(MouseEvent event) {
lastClickTime = now;
}
if (MouseButton.PRIMARY == event.getButton() && timeBetween < doubleClickThreshold) {
setCursor(Cursor.WAIT);
SwingUtilities.invokeLater(() -> {
try {
model.performDrill(key);
} catch (Exception e) {
String msg = DependencyExampleResources.format(DependencyExampleResources.DependencyExampleFxControl_drillLink_fail, key);
Logger.warn(FxDiagram.class, msg, e);
} finally {
Platform.runLater(() -> {
FxDiagram.this.setCursor(Cursor.DEFAULT);
});
}
});
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Cursor;
import java.util.Collections;

import javafx.application.Platform;
Expand Down Expand Up @@ -48,6 +49,7 @@
import oracle.dbtools.util.Logger;
import oracle.ide.Context;
import oracle.ide.Ide;
import oracle.ide.controls.WaitCursor;
import oracle.ide.editor.AsynchronousEditor;
import oracle.ide.editor.EditorManager;
import oracle.ide.model.UpdateMessage;
Expand Down Expand Up @@ -210,7 +212,7 @@ private void initFX(JFXPanel fxPanel) {
try {
dependencyExampleFxControl = new DependencyExampleFxControl();
Scene scene = SceneFactory.createScene(dependencyExampleFxControl.getRoot());
scene.setCamera(new PerspectiveCamera());
// GPU turned off in sqldev 18.1 scene.setCamera(new PerspectiveCamera());
fxPanel.setScene(scene);
}
catch(Exception e) {
Expand All @@ -230,6 +232,8 @@ private void loadContentModel(Context context) {
return;
}
}
final WaitCursor waitCursor = new WaitCursor(Ide.getMainWindow());
waitCursor.show();
dbObject = new DBObject(context.getNode());
multipleSelections = context.getSelection().length > 1;
dependencyModel = new DependencyExampleModel(context);
Expand All @@ -245,7 +249,9 @@ protected Object doWork() throws TaskException {
@Override
protected void invokeLater() {
// This is only called if the task finishes and is on the UI thread
dependencyExampleFxControl.setViewModel(dependencyModel);
dependencyExampleFxControl.setViewModel(dependencyModel, waitCursor);
// Force update UI
EditorManager.getEditorManager().refreshEditorUI(DependencyExampleGraphViewer.this);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
extension.id=oracle.db.example.sqldeveloper.extension.dumpObjectTypes
extension.name=Dump Object Types Action
extension.descr=Object action to dump an object type list as INFO to log window.
extension.version=1.0.0
extension.version=18.1.0
extension.resources=oracle.db.example.sqldeveloper.extension.dumpObjectTypes.DumpObjectTypesResources

extension.lib=external:$oracle.fcp.home$/sqldeveloper/extensions/${extension.id}/lib
Expand Down
2 changes: 1 addition & 1 deletion sqldeveloper/extension/java/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
## Standard Extensions (java)
Standard extensions are jar files with an [OSGi](https://en.wikipedia.org/wiki/OSGi) manifest and an extension.xml defining the extension and how it integrates with SQL Developer.

[Set up your environment](../setup.md). If using the eclipse project, also modify paths in *SQLDeveloper4.2.userlibraries* and import into eclipse.
[Set up your environment](../setup.md). If using the eclipse project, also modify paths in *SQLDeveloper18.1.userlibraries* and import into eclipse.

* [packaged XML](../xml/packaged)
XML Examples packaged as an extension.jar
Expand Down
43 changes: 43 additions & 0 deletions sqldeveloper/extension/java/SQLDeveloper18.1.userlibraries
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<eclipse-userlibraries version="2">
<library name="FXDiagram 0.35.0-SNAPSHOT" systemlibrary="false">
<archive path="/extension/java/DependencyExample/lib/com.google.guava-15.0.0.v201403281430.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.annotations-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.core-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.external-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.fxdiagram.lib-0.35.0-SNAPSHOT.jar"/>
<archive path="/extension/java/DependencyExample/lib/org.eclipse.emf.common-2.11.1.v20160208-0816.jar"/>
<archive path="/extension/java/DependencyExample/lib/org.eclipse.emf.ecore-2.11.2.v20160208-0816.jar"/>
<archive path="/extension/java/DependencyExample/lib/org.eclipse.emf.ecore.xmi-2.11.1.v20160208-0816.jar"/>
<archive path="/extension/java/DependencyExample/lib/org.eclipse.xtend.lib-2.10.0.v201605250459.jar"/>
<archive path="/extension/java/DependencyExample/lib/org.eclipse.xtext.xbase.lib-2.10.0.v201605250459.jar"/>
<archive path="/extension/java/DependencyExample/lib/de.cau.cs.kieler.kiml.graphviz.dot-0.7.1.201612130921.jar"/>
</library>
<library name="KIELER KLay Layouters v. 2015.02" systemlibrary="false">
<archive path="/extension/java/DependencyExample/lib/klay_2015-02.jar"/>
</library>
<library name="SQLDeveloper 18.1" systemlibrary="false">
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/ide/extensions/oracle.ide.db.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/ide/extensions/oracle.ide.jar" source="D:/workspace2/raptor_18.1/raptorbase-src.latest.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/ide/lib/idert.jar" source="D:/workspace2/raptor_18.1/raptorbase-src.latest.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/ide/lib/javatools.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/modules/oracle.javatools/javatools-nodeps.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/modules/oracle.javatools/oicons.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.utils.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/sqldeveloper/lib/dbtools-common.jar"/>
<archive path="D:/sqldeveloper-18.1.0/sqldeveloper/sqldeveloper/lib/oracle.sqldeveloper.jfx-nodeps.jar"/>
</library>
<library name="SQLDeveloper 4.2" systemlibrary="false">
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/ide/extensions/oracle.ide.db.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/ide/extensions/oracle.ide.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/ide/lib/idert.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/ide/lib/javatools.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/modules/oracle.javatools/javatools-nodeps.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/modules/oracle.javatools/oicons.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/sqldeveloper/extensions/oracle.sqldeveloper.utils.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/sqldeveloper/lib/oracle.dbtools-common.jar"/>
<archive path="D:/sqldeveloper-4.2.0.17.089.1709/sqldeveloper/sqldeveloper/lib/oracle.sqldeveloper.jfx-nodeps.jar"/>
</library>
</eclipse-userlibraries>
6 changes: 6 additions & 0 deletions sqldeveloper/extension/setenv.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
SET ANT_HOME=D:\apache-ant-1.10.3
SET JAVA_HOME=C:\Program Files\Java\jdk1.8.0_152
SET ANT_BIN=%ANT_HOME%\bin
SET SQLDEV_BIN=D:\sqldeveloper-18.1.0\sqldeveloper\sqldeveloper\bin
SET PATH=%PATH%;%ANT_BIN%;%SQLDEV_BIN%

Loading