-
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-1937 Added define view procedure action and accompanying act…
…ion guide constants * Commented out the Create REST WAR action set for 8.3 release * added JIRA to handle re-instating it when 1937 is completed.
- Loading branch information
Showing
4 changed files
with
108 additions
and
12 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
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
76 changes: 76 additions & 0 deletions
76
...igner.advisor.ui/src/org/teiid/designer/advisor/ui/actions/DefineViewProcedureAction.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,76 @@ | ||
/* | ||
* 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.advisor.ui.actions; | ||
|
||
import java.util.Properties; | ||
|
||
import org.eclipse.core.resources.IProject; | ||
import org.eclipse.jface.action.Action; | ||
import org.eclipse.jface.window.Window; | ||
import org.eclipse.ui.IWorkbenchWindow; | ||
import org.teiid.designer.advisor.ui.AdvisorUiConstants; | ||
import org.teiid.designer.advisor.ui.AdvisorUiPlugin; | ||
import org.teiid.designer.transformation.ui.editors.DefineViewProcedureDialog; | ||
import org.teiid.designer.ui.viewsupport.DesignerPropertiesUtil; | ||
import org.teiid.designer.ui.viewsupport.IPropertiesContext; | ||
import org.teiid.designer.ui.viewsupport.ModelerUiViewUtils; | ||
|
||
/** | ||
* | ||
*/ | ||
public class DefineViewProcedureAction extends Action implements AdvisorUiConstants { | ||
|
||
private Properties designerProperties; | ||
|
||
/** | ||
* Construct an instance of NewModelAction. | ||
*/ | ||
public DefineViewProcedureAction() { | ||
super(); | ||
setText("Define View Procedure"); //$NON-NLS-1$ | ||
setToolTipText("Define View Procedure Tooltip"); //$NON-NLS-1$ | ||
setImageDescriptor(AdvisorUiPlugin.getDefault().getImageDescriptor(Images.NEW_VIRTUAL_PROCEDURE_ICON)); | ||
|
||
} | ||
|
||
/** | ||
* @param properties the designer properties | ||
*/ | ||
public DefineViewProcedureAction( Properties properties ) { | ||
this(); | ||
this.designerProperties = properties; | ||
} | ||
|
||
/* (non-Javadoc) | ||
* @see org.eclipse.jface.action.IAction#run() | ||
*/ | ||
@Override | ||
public void run() { | ||
if( !ModelerUiViewUtils.workspaceHasOpenModelProjects() ) { | ||
IProject newProject = ModelerUiViewUtils.queryUserToCreateModelProject(); | ||
|
||
if( newProject != null ) { | ||
DesignerPropertiesUtil.setProjectName(designerProperties, newProject.getName()); | ||
} else { | ||
DesignerPropertiesUtil.setProjectStatus(this.designerProperties, IPropertiesContext.NO_OPEN_PROJECT); | ||
return; | ||
} | ||
} | ||
|
||
final IWorkbenchWindow iww = AdvisorUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); | ||
|
||
DefineViewProcedureDialog sdDialog = new DefineViewProcedureDialog(iww.getShell(), this.designerProperties); | ||
|
||
sdDialog.open(); | ||
|
||
if (sdDialog.getReturnCode() == Window.OK) { | ||
// Should do nothing since the user can select or create new project or do nothing | ||
// and the property for the Project will be set in the "designerProperties" | ||
} | ||
} | ||
} |