Skip to content

Commit 7c06bc5

Browse files
authored
Merge pull request #26 from eharris369/24-addOpenImportProjectPageAction
Issue #24: Add open import project page action
2 parents 249729f + ada80aa commit 7c06bc5

File tree

7 files changed

+29
-17
lines changed

7 files changed

+29
-17
lines changed

dev/com.ibm.microclimate.core/plugin.properties

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2018 IBM Corporation and others.
2+
# Copyright (c) 2018, 2019 IBM Corporation and others.
33
# All rights reserved. This program and the accompanying materials
44
# are made available under the terms of the Eclipse Public License v2.0
55
# which accompanies this distribution, and is available at
@@ -15,10 +15,6 @@
1515
Bundle-Vendor = IBM
1616
Bundle-Name = Microclimate Developer Tools
1717

18-
MICROCLIMATE_SERVER_ID=microclimate.server
19-
SERVER_NAME=Microclimate Server
20-
SERVER_DESCRIPTION=Server representing a Microclimate project
21-
2218
LAUNCH_CONFIG_NAME=Microclimate Project
2319

2420
VALIDATION_MARKER=Microclimate Problem

dev/com.ibm.microclimate.core/src/com/ibm/microclimate/core/internal/connection/MicroclimateConnection.java

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,13 +599,21 @@ public IPath getWorkspacePath() {
599599
}
600600

601601
public URI getNewProjectURI() {
602+
return getProjectURI(MCConstants.QUERY_NEW_PROJECT);
603+
}
604+
605+
public URI getImportProjectURI() {
606+
return getProjectURI(MCConstants.QUERY_IMPORT_PROJECT);
607+
}
608+
609+
private URI getProjectURI(String projectQuery) {
602610
try {
603611
URI uri = baseUrl;
604-
String query = MCConstants.QUERY_NEW_PROJECT + "=" + MCConstants.VALUE_TRUE;
612+
String query = projectQuery + "=" + MCConstants.VALUE_TRUE;
605613
uri = new URI(uri.getScheme(), uri.getAuthority(), uri.getPath(), query, uri.getFragment());
606614
return uri;
607615
} catch (Exception e) {
608-
MCLogger.logError("Failed to get the URI for the new project page.", e); //$NON-NLS-1$
616+
MCLogger.logError("Failed to get the project URI for the query: " + projectQuery, e); //$NON-NLS-1$
609617
}
610618
return null;
611619
}

dev/com.ibm.microclimate.core/src/com/ibm/microclimate/core/internal/constants/MCConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ private MCConstants() {}
111111
DOCKERFILE_BUILD = "Dockerfile-build",
112112

113113
QUERY_NEW_PROJECT = "new-project",
114+
QUERY_IMPORT_PROJECT = "import-project",
114115
VALUE_TRUE = "true",
115116

116117
QUERY_PROJECT = "project",

dev/com.ibm.microclimate.ui/plugin.properties

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2018 IBM Corporation and others.
2+
# Copyright (c) 2018, 2019 IBM Corporation and others.
33
# All rights reserved. This program and the accompanying materials
44
# are made available under the terms of the Eclipse Public License v2.0
55
# which accompanies this distribution, and is available at
@@ -18,7 +18,8 @@ Bundle-Name = Microclimate UI Plugin
1818
ACTION_REFRESH=Re&fresh
1919

2020
ACTION_OPEN_MICROCLIMATE_UI=Open Microclimate &UI
21-
ACTION_CREATE_NEW_PROJECT=Create New &Project
21+
ACTION_CREATE_NEW_PROJECT=Open Create &Project Page
22+
ACTION_IMPORT_PROJECT=Open &Import Project Page
2223
ACTION_REMOVE_CONNECTION=&Remove Connection
2324

2425
ACTION_OPEN_APP=&Open Application
@@ -36,10 +37,6 @@ ACTION_OPEN_APP_OVERVIEW=Open Project O&verview
3637
PREFS_PARENT_PAGE_NAME=Microclimate
3738
PREFS_CONNECTION_PAGE_NAME=Microclimate Connections
3839

39-
MICROCLIMATE_SERVER_ID=microclimate.server
40-
41-
SERVER_DECORATOR_LABEL=Microclimate Server
42-
4340
MICROCLIMATE_CATEGORY_NAME=Microclimate
4441
MICROCLIMATE_VIEW_NAME=Microclimate Explorer
4542
NAVIGATOR_CONTENT_NAME=Microclimate Navigator Content

dev/com.ibm.microclimate.ui/plugin.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

33
<!--
4-
Copyright (c) 2018 IBM Corporation and others.
4+
Copyright (c) 2018, 2019 IBM Corporation and others.
55
All rights reserved. This program and the accompanying materials
66
are made available under the terms of the Eclipse Public License v2.0
77
which accompanies this distribution, and is available at
@@ -210,6 +210,13 @@
210210
menubarPath="group.additions"
211211
label="%ACTION_REMOVE_CONNECTION"
212212
class="com.ibm.microclimate.ui.internal.actions.RemoveConnectionAction"/>
213+
<action
214+
id="com.ibm.microclimate.ui.importProject"
215+
enablesFor="1"
216+
menubarPath="group.new"
217+
icon="%DEFAULT_ICON_PATH"
218+
label="%ACTION_IMPORT_PROJECT"
219+
class="com.ibm.microclimate.ui.internal.actions.OpenMicroclimateUIAction"/>
213220
<action
214221
id="com.ibm.microclimate.ui.createNewProject"
215222
enablesFor="1"

dev/com.ibm.microclimate.ui/src/com/ibm/microclimate/ui/internal/actions/OpenMicroclimateUIAction.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2018 IBM Corporation and others.
2+
* Copyright (c) 2018, 2019 IBM Corporation and others.
33
* All rights reserved. This program and the accompanying materials
44
* are made available under the terms of the Eclipse Public License v2.0
55
* which accompanies this distribution, and is available at
@@ -35,6 +35,7 @@
3535
public class OpenMicroclimateUIAction implements IObjectActionDelegate {
3636

3737
private final String CREATE_NEW_PROJECT_ID = "com.ibm.microclimate.ui.createNewProject";
38+
private final String IMPORT_PROJECT_ID = "com.ibm.microclimate.ui.importProject";
3839

3940
protected MicroclimateConnection connection;
4041

@@ -75,6 +76,8 @@ public void run(IAction action) {
7576
URI uri = null;
7677
if (CREATE_NEW_PROJECT_ID.equals(action.getId())) {
7778
uri = connection.getNewProjectURI();
79+
} else if (IMPORT_PROJECT_ID.equals(action.getId())) {
80+
uri = connection.getImportProjectURI();
7881
}
7982
if (uri == null) {
8083
uri = connection.baseUrl;

dev/com.ibm.microclimate.ui/src/com/ibm/microclimate/ui/internal/messages/messages.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
###############################################################################
2-
# Copyright (c) 2018 IBM Corporation and others.
2+
# Copyright (c) 2018, 2019 IBM Corporation and others.
33
# All rights reserved. This program and the accompanying materials
44
# are made available under the terms of the Eclipse Public License v2.0
55
# which accompanies this distribution, and is available at
@@ -44,7 +44,7 @@ StartBuildAction_AlreadyBuildingMsg=The project {0} is already building. Wait fo
4444
MicroclimateConnectionLabel=MicroclimateConnection:
4545
MicroclimateDisconnected=Disconnected. Check that Microclimate is running.
4646
MicroclimateProjectDisabled=Disabled
47-
MicroclimateConnectionNoProjects=No projects. Right click and select Create New Project.
47+
MicroclimateConnectionNoProjects=No projects. Right click and select Open Create Project Page.
4848

4949
RestartInDebugMode=&Restart in Debug Mode
5050
RestartInRunMode=&Restart in Run Mode

0 commit comments

Comments
 (0)