-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TEIIDDES-1663: Refactor the relational and transformation dialogs
* The child actions for relational and view diagrams create dialogs from classes that duplicate the same functionality. This refactors the classes so that only one class displays the dialog and its factories are replaced with diagram models that provide the small differences in functionality. * [*]Action * The dialog requires a dialog model which encapsulates both the relational object and selected file * Dialog updates * Icons for description and sql tabs * Help text is moved from the main panel to the message area of the dialog * [*]Panel * Extends the use of the abstract parent class to reduce code duplication * The dialog model is passed in as the container for the reference and model file * Replacement of GridData and GridLayout instances with the use of GridDataFactory and GridLayoutFactory * Removes all use of hint heights to address the specific sizing issue. Neither the tab folder nor the name text components have priority over the sizing. * Removes spacers to reduce real-estate requirements of dialogs
- Loading branch information
Paul Richardson
committed
May 30, 2013
1 parent
4d2f702
commit 58cc54b
Showing
34 changed files
with
2,232 additions
and
3,343 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+517 Bytes
...ns/org.teiid.designer.relational.ui/icons/full/obj16/edit-description-error.png
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
BIN
+523 Bytes
.../org.teiid.designer.relational.ui/icons/full/obj16/edit-description-warning.png
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
BIN
+496 Bytes
plugins/org.teiid.designer.relational.ui/icons/full/obj16/edit-description.png
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
BIN
+370 Bytes
plugins/org.teiid.designer.relational.ui/icons/full/obj16/native-sql-error.png
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
BIN
+390 Bytes
plugins/org.teiid.designer.relational.ui/icons/full/obj16/native-sql-warning.png
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
BIN
+301 Bytes
plugins/org.teiid.designer.relational.ui/icons/full/obj16/native-sql.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
93 changes: 93 additions & 0 deletions
93
...signer.relational.ui/src/org/teiid/designer/relational/ui/edit/RelationalDialogModel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* JBoss, Home of Professional Open Source. | ||
* | ||
* See the LEGAL.txt file distributed with this work for information regarding copyright ownership and licensing. | ||
* | ||
* See the AUTHORS.txt file distributed with this work for a full listing of individual contributors. | ||
*/ | ||
package org.teiid.designer.relational.ui.edit; | ||
|
||
import org.eclipse.core.resources.IFile; | ||
import org.eclipse.osgi.util.NLS; | ||
import org.eclipse.swt.widgets.Composite; | ||
import org.teiid.designer.relational.model.RelationalIndex; | ||
import org.teiid.designer.relational.model.RelationalProcedure; | ||
import org.teiid.designer.relational.model.RelationalReference; | ||
import org.teiid.designer.relational.model.RelationalTable; | ||
import org.teiid.designer.relational.model.RelationalView; | ||
import org.teiid.designer.relational.ui.Messages; | ||
import org.teiid.designer.relational.ui.editor.EditRelationalObjectDialogModel; | ||
|
||
/** | ||
* Dialog model class designed to provide generic editor panels for specific relational object types | ||
* | ||
* @since 8.0 | ||
*/ | ||
public class RelationalDialogModel extends EditRelationalObjectDialogModel { | ||
|
||
/** | ||
* @param relationalObject | ||
* @param modelFile | ||
*/ | ||
public RelationalDialogModel(RelationalReference relationalObject, | ||
IFile modelFile) { | ||
super(relationalObject, modelFile); | ||
} | ||
|
||
@Override | ||
public RelationalEditorPanel getEditorPanel(IDialogStatusListener statusListener, | ||
Composite parent) { | ||
if (relationalObject instanceof RelationalTable) { | ||
return new RelationalTableEditorPanel(parent, this, statusListener); | ||
} else if (relationalObject instanceof RelationalProcedure) { | ||
return new RelationalProcedureEditorPanel(parent, this, statusListener); | ||
} else if (relationalObject instanceof RelationalIndex) { | ||
return new RelationalIndexEditorPanel(parent, this, statusListener); | ||
} | ||
|
||
return null; | ||
} | ||
|
||
@Override | ||
public String getDialogTitle() { | ||
if (relationalObject instanceof RelationalView) { | ||
return Messages.createRelationalViewTitle; | ||
} else if (relationalObject instanceof RelationalTable) { | ||
return Messages.createRelationalTableTitle; | ||
} else if (relationalObject instanceof RelationalProcedure) { | ||
RelationalProcedure procedure = (RelationalProcedure)relationalObject; | ||
if (procedure.isSourceFunction()) { | ||
return Messages.createRelationalSourceFunctionTitle; | ||
} else if (procedure.isFunction()) { | ||
return Messages.createRelationalUserDefinedFunctionTitle; | ||
} | ||
return Messages.createRelationalProcedureTitle; | ||
} else if (relationalObject instanceof RelationalIndex) { | ||
return Messages.createRelationalIndexTitle; | ||
} | ||
|
||
return NLS.bind(Messages.unsupportedObjectType, relationalObject.getClass().toString()); | ||
} | ||
|
||
@Override | ||
public String getHelpText() { | ||
if (relationalObject instanceof RelationalView) { | ||
return Messages.createRelationalViewHelpText; | ||
} else if (relationalObject instanceof RelationalTable) { | ||
return Messages.createRelationalTableHelpText; | ||
} else if (relationalObject instanceof RelationalProcedure) { | ||
RelationalProcedure procedure = (RelationalProcedure)relationalObject; | ||
if (procedure.isSourceFunction()) { | ||
return Messages.createRelationalSourceFunctionHelpText; | ||
} else if (procedure.isFunction()) { | ||
return Messages.createRelationalUserDefinedFunctionHelpText; | ||
} | ||
|
||
return Messages.createRelationalProcedureHelpText; | ||
} else if (relationalObject instanceof RelationalIndex) { | ||
return Messages.createRelationalIndexHelpText; | ||
} | ||
|
||
return NLS.bind(Messages.unsupportedObjectType, relationalObject.getClass().toString()); | ||
} | ||
} |
Oops, something went wrong.