Skip to content

Commit d25c2a6

Browse files
authored
Merge pull request #41 from lawson89/master
Migrate to org.httprpc.sierra.tools and pull common attributes from UILoader
2 parents 01b3c82 + bb20b54 commit d25c2a6

File tree

9 files changed

+17
-23
lines changed

9 files changed

+17
-23
lines changed

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/MainFrame.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/MainFrame.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer;
14+
package org.httprpc.sierra.tools.previewer;
1515

1616
import org.fife.ui.autocomplete.AutoCompletion;
1717
import org.fife.ui.autocomplete.CompletionProvider;
1818
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
1919
import org.fife.ui.rsyntaxtextarea.SyntaxConstants;
2020
import org.httprpc.sierra.Outlet;
2121
import org.httprpc.sierra.UILoader;
22-
import org.httprpc.sierra.previewer.engine.RenderingEngine;
23-
import org.httprpc.sierra.previewer.model.RenderError;
24-
import org.httprpc.sierra.previewer.model.RenderResult;
22+
import org.httprpc.sierra.tools.previewer.engine.RenderingEngine;
23+
import org.httprpc.sierra.tools.previewer.model.RenderError;
24+
import org.httprpc.sierra.tools.previewer.model.RenderResult;
2525

2626
import javax.swing.ImageIcon;
2727
import javax.swing.JFileChooser;

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/RecentFilesManager.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/RecentFilesManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer;
14+
package org.httprpc.sierra.tools.previewer;
1515

1616
import java.nio.file.Path;
1717
import java.nio.file.Paths;

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/SierraPreviewerApp.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/SierraPreviewerApp.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer;
14+
package org.httprpc.sierra.tools.previewer;
1515

1616
import com.formdev.flatlaf.FlatLightLaf;
1717

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer;
14+
package org.httprpc.sierra.tools.previewer;
1515

1616
import org.fife.ui.autocomplete.BasicCompletion;
1717
import org.fife.ui.autocomplete.Completion;
@@ -73,17 +73,10 @@ private void loadTags() {
7373

7474
private void addCommonAttributes() {
7575
Map<String, String> attributes = new HashMap<>();
76-
// Add common attributes applicable to all components
77-
attributes.put("name", "String");
78-
attributes.put("group", "String");
79-
attributes.put("border", "String");
80-
attributes.put("padding", "String");
81-
attributes.put("weight", "String");
82-
attributes.put("size", "String");
83-
attributes.put("tabTitle", "String");
84-
attributes.put("tabIcon", "String");
85-
attributes.put("style", "String");
86-
attributes.put("styleClass", "String");
76+
// Add common attributes from UILoader.Attribute enum
77+
for (UILoader.Attribute attr : UILoader.Attribute.values()) {
78+
attributes.put(attr.getName(), attr.getType().getSimpleName());
79+
}
8780
baseClassAttributeDefinitions.put("CommonAttributes", attributes);
8881
}
8982

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/engine/RenderingEngine.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/engine/RenderingEngine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer.engine;
14+
package org.httprpc.sierra.tools.previewer.engine;
1515

1616
import org.httprpc.sierra.UILoader;
17-
import org.httprpc.sierra.previewer.model.RenderError;
18-
import org.httprpc.sierra.previewer.model.RenderResult;
17+
import org.httprpc.sierra.tools.previewer.model.RenderError;
18+
import org.httprpc.sierra.tools.previewer.model.RenderResult;
1919

2020
import javax.swing.JPanel;
2121
import java.io.IOException;

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/model/RenderError.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/model/RenderError.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer.model;
14+
package org.httprpc.sierra.tools.previewer.model;
1515

1616
/**
1717
* A record to hold detailed information about a rendering failure. Implements

sierra-tools/previewer/src/main/java/org/httprpc/sierra/previewer/model/RenderResult.java renamed to sierra-tools/previewer/src/main/java/org/httprpc/sierra/tools/previewer/model/RenderResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* See the License for the specific language governing permissions and
1212
* limitations under the License.
1313
*/
14-
package org.httprpc.sierra.previewer.model;
14+
package org.httprpc.sierra.tools.previewer.model;
1515

1616
import javax.swing.JComponent;
1717

sierra-tools/previewer/src/test/java/org/httprpc/sierra/previewer/SierraXMLCompletionProviderTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
package org.httprpc.sierra.previewer;
1515

1616
import org.fife.ui.autocomplete.Completion;
17+
import org.httprpc.sierra.tools.previewer.SierraXMLCompletionProvider;
1718
import org.junit.jupiter.api.BeforeEach;
1819
import org.junit.jupiter.api.Test;
1920

0 commit comments

Comments
 (0)